mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.0.1363: recover swap file ending with .stz #9002
Problem: Recovering does not work when swap file ends in .stz.
Solution: Check for all possible swap file names. (Elfling, closes vim/vim#2395,
closes vim/vim#2396)
af903e5d49
This commit is contained in:
parent
dadcfe22ca
commit
3bce5207cf
@ -769,17 +769,16 @@ void ml_recover(void)
|
|||||||
called_from_main = (curbuf->b_ml.ml_mfp == NULL);
|
called_from_main = (curbuf->b_ml.ml_mfp == NULL);
|
||||||
attr = HL_ATTR(HLF_E);
|
attr = HL_ATTR(HLF_E);
|
||||||
|
|
||||||
/*
|
// If the file name ends in ".s[a-w][a-z]" we assume this is the swap file.
|
||||||
* If the file name ends in ".s[uvw][a-z]" we assume this is the swap file.
|
// Otherwise a search is done to find the swap file(s).
|
||||||
* Otherwise a search is done to find the swap file(s).
|
|
||||||
*/
|
|
||||||
fname = curbuf->b_fname;
|
fname = curbuf->b_fname;
|
||||||
if (fname == NULL) /* When there is no file name */
|
if (fname == NULL) /* When there is no file name */
|
||||||
fname = (char_u *)"";
|
fname = (char_u *)"";
|
||||||
len = (int)STRLEN(fname);
|
len = (int)STRLEN(fname);
|
||||||
if (len >= 4
|
if (len >= 4
|
||||||
&& STRNICMP(fname + len - 4, ".s", 2) == 0
|
&& STRNICMP(fname + len - 4, ".s", 2) == 0
|
||||||
&& vim_strchr((char_u *)"UVWuvw", fname[len - 2]) != NULL
|
&& vim_strchr((char_u *)"abcdefghijklmnopqrstuvw",
|
||||||
|
TOLOWER_ASC(fname[len - 2])) != NULL
|
||||||
&& ASCII_ISALPHA(fname[len - 1])) {
|
&& ASCII_ISALPHA(fname[len - 1])) {
|
||||||
directly = TRUE;
|
directly = TRUE;
|
||||||
fname_used = vim_strsave(fname); /* make a copy for mf_open() */
|
fname_used = vim_strsave(fname); /* make a copy for mf_open() */
|
||||||
|
Loading…
Reference in New Issue
Block a user