comparison src/os_mswin.c @ 26821:81f0d5a958b9 v8.2.3939

patch 8.2.3939: MS-Windows: fnamemodify('', ':p') does not work Commit: https://github.com/vim/vim/commit/5a664fe57fe7ba65a771bc95ef1c205e4db193b7 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Wed Dec 29 18:16:21 2021 +0000 patch 8.2.3939: MS-Windows: fnamemodify('', ':p') does not work Problem: MS-Windows: fnamemodify('', ':p') does not work. Solution: Do not consider an empty string a full path. (Yegappan Lakshmanan, closes #9428, closes #9427)
author Bram Moolenaar <Bram@vim.org>
date Wed, 29 Dec 2021 19:30:03 +0100
parents fc859aea8cec
children 06a137af96f8
comparison
equal deleted inserted replaced
26820:6a6a985ee1d5 26821:81f0d5a958b9
388 // A name like "d:/foo" and "//server/share" is absolute. "d:foo" is not. 388 // A name like "d:/foo" and "//server/share" is absolute. "d:foo" is not.
389 // Another way to check is to use mch_FullName() and see if the result is 389 // Another way to check is to use mch_FullName() and see if the result is
390 // the same as the name or mch_FullName() fails. However, this has quite a 390 // the same as the name or mch_FullName() fails. However, this has quite a
391 // bit of overhead, so let's not do that. 391 // bit of overhead, so let's not do that.
392 if (*fname == NUL) 392 if (*fname == NUL)
393 return TRUE; 393 return FALSE;
394 return ((ASCII_ISALPHA(fname[0]) && fname[1] == ':' 394 return ((ASCII_ISALPHA(fname[0]) && fname[1] == ':'
395 && (fname[2] == '/' || fname[2] == '\\')) 395 && (fname[2] == '/' || fname[2] == '\\'))
396 || (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\'))); 396 || (fname[0] == fname[1] && (fname[0] == '/' || fname[0] == '\\')));
397 } 397 }
398 398