Mercurial > vim
comparison src/ex_cmds.c @ 16738:b52ea9c5f1db v8.1.1371
patch 8.1.1371: cannot recover from a swap file
commit https://github.com/vim/vim/commit/99499b1c05f85f83876b828eea3f6e14f0f407b4
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu May 23 21:35:48 2019 +0200
patch 8.1.1371: cannot recover from a swap file
Problem: Cannot recover from a swap file.
Solution: Do not expand environment variables in the swap file name.
Do not check the extension when we already know a file is a swap
file. (Ken Takata, closes 4415, closes #4369)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 23 May 2019 21:45:07 +0200 |
parents | 5a541d459ef7 |
children | ef00b6bc186b |
comparison
equal
deleted
inserted
replaced
16737:e56018f01ba7 | 16738:b52ea9c5f1db |
---|---|
7000 while (*p != NUL) | 7000 while (*p != NUL) |
7001 { | 7001 { |
7002 copy_option_part(&p, NameBuff, MAXPATHL, ","); | 7002 copy_option_part(&p, NameBuff, MAXPATHL, ","); |
7003 mustfree = FALSE; | 7003 mustfree = FALSE; |
7004 rt = vim_getenv((char_u *)"VIMRUNTIME", &mustfree); | 7004 rt = vim_getenv((char_u *)"VIMRUNTIME", &mustfree); |
7005 if (rt != NULL && fullpathcmp(rt, NameBuff, FALSE) != FPC_SAME) | 7005 if (rt != NULL && |
7006 fullpathcmp(rt, NameBuff, FALSE, TRUE) != FPC_SAME) | |
7006 { | 7007 { |
7007 int fcount; | 7008 int fcount; |
7008 char_u **fnames; | 7009 char_u **fnames; |
7009 FILE *fd; | 7010 FILE *fd; |
7010 char_u *s; | 7011 char_u *s; |
7222 * If using the "++t" argument or generating tags for "$VIMRUNTIME/doc" | 7223 * If using the "++t" argument or generating tags for "$VIMRUNTIME/doc" |
7223 * add the "help-tags" tag. | 7224 * add the "help-tags" tag. |
7224 */ | 7225 */ |
7225 ga_init2(&ga, (int)sizeof(char_u *), 100); | 7226 ga_init2(&ga, (int)sizeof(char_u *), 100); |
7226 if (add_help_tags || fullpathcmp((char_u *)"$VIMRUNTIME/doc", | 7227 if (add_help_tags || fullpathcmp((char_u *)"$VIMRUNTIME/doc", |
7227 dir, FALSE) == FPC_SAME) | 7228 dir, FALSE, TRUE) == FPC_SAME) |
7228 { | 7229 { |
7229 if (ga_grow(&ga, 1) == FAIL) | 7230 if (ga_grow(&ga, 1) == FAIL) |
7230 got_int = TRUE; | 7231 got_int = TRUE; |
7231 else | 7232 else |
7232 { | 7233 { |