mirror of
https://github.com/vim/vim.git
synced 2025-11-15 23:14:06 -05:00
updated for version 7.3.690
Problem: When the current directory name is exactly the maximum path length
Vim may crash.
Solution: Only add "/" when there is room. (Danek Duvall)
This commit is contained in:
@@ -2512,15 +2512,12 @@ mch_FullName(fname, buf, len, force)
|
||||
}
|
||||
|
||||
l = STRLEN(buf);
|
||||
if (l >= len)
|
||||
retval = FAIL;
|
||||
if (l >= len - 1)
|
||||
retval = FAIL; /* no space for trailing "/" */
|
||||
#ifndef VMS
|
||||
else
|
||||
{
|
||||
if (l > 0 && buf[l - 1] != '/' && *fname != NUL
|
||||
else if (l > 0 && buf[l - 1] != '/' && *fname != NUL
|
||||
&& STRCMP(fname, ".") != 0)
|
||||
STRCAT(buf, "/");
|
||||
}
|
||||
STRCAT(buf, "/");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user