Last active
November 11, 2015 16:39
-
-
Save Milly/b403b935d3f0e5c4bb7b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/os_unix.c b/src/os_unix.c | |
index 8f059be..f7f4115 100644 | |
--- a/src/os_unix.c | |
+++ b/src/os_unix.c | |
@@ -2498,6 +2498,14 @@ mch_FullName(fname, buf, len, force) | |
# else | |
cygwin_conv_to_posix_path(fname, posix_fname); | |
# endif | |
+ if (STRCMP(fname, posix_fname) != 0) | |
+ { | |
+ l = STRLEN(posix_fname); | |
+ while (0 < --l && posix_fname[l] == '/') | |
+ { | |
+ posix_fname[l] = NUL; | |
+ } | |
+ } | |
fname = posix_fname; | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
function s:test() | |
let r = [] | |
for s in [ | |
\ '.', | |
\ './', | |
\ './/', | |
\ '..', | |
\ '../', | |
\ '..//', | |
\ 'file', | |
\ 'file/', | |
\ 'file//', | |
\ 'dir', | |
\ 'dir/', | |
\ 'dir//', | |
\ 'notexists', | |
\ 'notexists/', | |
\ 'notexists//', | |
\ ] | |
call add(r, printf('%-16s -> %s', s, fnamemodify(s, ':.'))) | |
endfor | |
call writefile(r, '/tmp/out.txt') | |
endfunction | |
cd /tmp | |
call mkdir('/tmp/dir') | |
call writefile([], '/tmp/file') | |
call s:test() | |
quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment