diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-01-03 19:22:13 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-01-03 19:22:13 +0000 |
commit | 525ad4d05fe5df6d8d5b9c7daa5f5dcb91c3d9d8 (patch) | |
tree | 50997737b8121f3c4ffcf85bf83e7bfd94177961 /src/mark.c | |
parent | b238909e065a6bf89821c3aef4e079d34222d18d (diff) | |
download | vim-git-525ad4d05fe5df6d8d5b9c7daa5f5dcb91c3d9d8.tar.gz |
updated for version 7.1-195v7.1.195
Diffstat (limited to 'src/mark.c')
-rw-r--r-- | src/mark.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mark.c b/src/mark.c index 764ad36ee..6dc593440 100644 --- a/src/mark.c +++ b/src/mark.c @@ -505,9 +505,24 @@ fname2fnum(fm) { /* * First expand "~/" in the file name to the home directory. - * Try to shorten the file name. + * Don't expand the whole name, it may contain other '~' chars. */ - expand_env(fm->fname, NameBuff, MAXPATHL); + if (fm->fname[0] == '~' && (fm->fname[1] == '/' +#ifdef BACKSLASH_IN_FILENAME + || fm->fname[1] == '\\' +#endif + )) + { + int len; + + expand_env((char_u *)"~/", NameBuff, MAXPATHL); + len = STRLEN(NameBuff); + vim_strncpy(NameBuff + len, fm->fname + 2, MAXPATHL - len - 1); + } + else + vim_strncpy(NameBuff, fm->fname, MAXPATHL - 1); + + /* Try to shorten the file name. */ mch_dirname(IObuff, IOSIZE); p = shorten_fname(NameBuff, IObuff); |