Mirror of the Vim source from https://github.com/vim/vim
Revisão | 801d5544828215bf644cbc6ababfc66beec6cb2d (tree) |
---|---|
Hora | 2008-01-04 04:22:13 |
Autor | vimboss |
Commiter | vimboss |
updated for version 7.1-195
@@ -505,9 +505,24 @@ | ||
505 | 505 | { |
506 | 506 | /* |
507 | 507 | * First expand "~/" in the file name to the home directory. |
508 | - * Try to shorten the file name. | |
508 | + * Don't expand the whole name, it may contain other '~' chars. | |
509 | 509 | */ |
510 | - expand_env(fm->fname, NameBuff, MAXPATHL); | |
510 | + if (fm->fname[0] == '~' && (fm->fname[1] == '/' | |
511 | +#ifdef BACKSLASH_IN_FILENAME | |
512 | + || fm->fname[1] == '\\' | |
513 | +#endif | |
514 | + )) | |
515 | + { | |
516 | + int len; | |
517 | + | |
518 | + expand_env((char_u *)"~/", NameBuff, MAXPATHL); | |
519 | + len = STRLEN(NameBuff); | |
520 | + vim_strncpy(NameBuff + len, fm->fname + 2, MAXPATHL - len - 1); | |
521 | + } | |
522 | + else | |
523 | + vim_strncpy(NameBuff, fm->fname, MAXPATHL - 1); | |
524 | + | |
525 | + /* Try to shorten the file name. */ | |
511 | 526 | mch_dirname(IObuff, IOSIZE); |
512 | 527 | p = shorten_fname(NameBuff, IObuff); |
513 | 528 |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 195, | |
671 | +/**/ | |
670 | 672 | 194, |
671 | 673 | /**/ |
672 | 674 | 193, |