mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.2.3468: problem with :cd when editing file in non-existent directory
Problem: Problem with :cd when editing file in non-existent directory. (Yee Cheng Chin) Solution: Prepend the current directory to get the full path. (closes #8903)
This commit is contained in:
@@ -2647,7 +2647,15 @@ mch_FullName(
|
||||
{
|
||||
vim_strncpy(buf, fname, p - fname);
|
||||
if (mch_chdir((char *)buf))
|
||||
retval = FAIL;
|
||||
{
|
||||
// Path does not exist (yet). For a full path fail,
|
||||
// will use the path as-is. For a relative path use
|
||||
// the current directory and append the file name.
|
||||
if (mch_isFullName(fname))
|
||||
retval = FAIL;
|
||||
else
|
||||
p = NULL;
|
||||
}
|
||||
else if (*p == '/')
|
||||
fname = p + 1;
|
||||
else
|
||||
|
Reference in New Issue
Block a user