Mercurial > vim
changeset 1480:801d55448282 v7.1.195
updated for version 7.1-195
author | vimboss |
---|---|
date | Thu, 03 Jan 2008 19:22:13 +0000 |
parents | ae7e29b64923 |
children | 0c61c201ba76 |
files | src/mark.c src/version.c |
diffstat | 2 files changed, 19 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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);