mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.3388: fnamemodify('path/..', ':p') differs from using 'path/../'
Problem: fnamemodify('path/..', ':p') differs from using 'path/../'. Solution: Include the "/.." in the directory name. (closes #8808)
This commit is contained in:
@@ -2602,6 +2602,10 @@ mch_FullName(
|
||||
*/
|
||||
if (p != NULL)
|
||||
{
|
||||
if (STRCMP(p, "/..") == 0)
|
||||
// for "/path/dir/.." include the "/.."
|
||||
p += 3;
|
||||
|
||||
#ifdef HAVE_FCHDIR
|
||||
/*
|
||||
* Use fchdir() if possible, it's said to be faster and more
|
||||
@@ -2644,8 +2648,10 @@ mch_FullName(
|
||||
vim_strncpy(buf, fname, p - fname);
|
||||
if (mch_chdir((char *)buf))
|
||||
retval = FAIL;
|
||||
else
|
||||
else if (*p == '/')
|
||||
fname = p + 1;
|
||||
else
|
||||
fname = p;
|
||||
*buf = NUL;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user