Mercurial > vim
changeset 3867:caa0ca9ad06c v7.3.690
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)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 14 Oct 2012 04:35:45 +0200 |
parents | 7c95e59d681d |
children | 9f622266fbf4 |
files | src/os_unix.c src/version.c |
diffstat | 2 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/os_unix.c +++ b/src/os_unix.c @@ -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 }