mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
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)
This commit is contained in:
14
src/main.c
14
src/main.c
@@ -2684,7 +2684,7 @@ create_windows(mparm_T *parmp UNUSED)
|
||||
if (recoverymode) /* do recover */
|
||||
{
|
||||
msg_scroll = TRUE; /* scroll message up */
|
||||
ml_recover();
|
||||
ml_recover(TRUE);
|
||||
if (curbuf->b_ml.ml_mfp == NULL) /* failed */
|
||||
getout(1);
|
||||
do_modelines(0); /* do modelines */
|
||||
@@ -3101,18 +3101,18 @@ source_startup_scripts(mparm_T *parmp)
|
||||
|
||||
i = FAIL;
|
||||
if (fullpathcmp((char_u *)USR_VIMRC_FILE,
|
||||
(char_u *)VIMRC_FILE, FALSE) != FPC_SAME
|
||||
(char_u *)VIMRC_FILE, FALSE, TRUE) != FPC_SAME
|
||||
#ifdef USR_VIMRC_FILE2
|
||||
&& fullpathcmp((char_u *)USR_VIMRC_FILE2,
|
||||
(char_u *)VIMRC_FILE, FALSE) != FPC_SAME
|
||||
(char_u *)VIMRC_FILE, FALSE, TRUE) != FPC_SAME
|
||||
#endif
|
||||
#ifdef USR_VIMRC_FILE3
|
||||
&& fullpathcmp((char_u *)USR_VIMRC_FILE3,
|
||||
(char_u *)VIMRC_FILE, FALSE) != FPC_SAME
|
||||
(char_u *)VIMRC_FILE, FALSE, TRUE) != FPC_SAME
|
||||
#endif
|
||||
#ifdef SYS_VIMRC_FILE
|
||||
&& fullpathcmp((char_u *)SYS_VIMRC_FILE,
|
||||
(char_u *)VIMRC_FILE, FALSE) != FPC_SAME
|
||||
(char_u *)VIMRC_FILE, FALSE, TRUE) != FPC_SAME
|
||||
#endif
|
||||
)
|
||||
i = do_source((char_u *)VIMRC_FILE, TRUE, DOSO_VIMRC);
|
||||
@@ -3127,10 +3127,10 @@ source_startup_scripts(mparm_T *parmp)
|
||||
secure = 0;
|
||||
#endif
|
||||
if ( fullpathcmp((char_u *)USR_EXRC_FILE,
|
||||
(char_u *)EXRC_FILE, FALSE) != FPC_SAME
|
||||
(char_u *)EXRC_FILE, FALSE, TRUE) != FPC_SAME
|
||||
#ifdef USR_EXRC_FILE2
|
||||
&& fullpathcmp((char_u *)USR_EXRC_FILE2,
|
||||
(char_u *)EXRC_FILE, FALSE) != FPC_SAME
|
||||
(char_u *)EXRC_FILE, FALSE, TRUE) != FPC_SAME
|
||||
#endif
|
||||
)
|
||||
(void)do_source((char_u *)EXRC_FILE, FALSE, DOSO_NONE);
|
||||
|
Reference in New Issue
Block a user