comparison src/memline.c @ 12975:e311187347c1 v8.0.1363

patch 8.0.1363: recovering does not work when swap file ends in .stz commit https://github.com/vim/vim/commit/af903e5d490ec9c6c49079f67de7e92e3c35a725 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Dec 2 15:11:22 2017 +0100 patch 8.0.1363: recovering does not work when swap file ends in .stz Problem: Recovering does not work when swap file ends in .stz. Solution: Check for all possible swap file names. (Elfling, closes https://github.com/vim/vim/issues/2395, closes #2396)
author Christian Brabandt <cb@256bit.org>
date Sat, 02 Dec 2017 15:15:05 +0100
parents 68d7bc045dbe
children ac42c4b11dbc
comparison
equal deleted inserted replaced
12974:f7e78e142aa8 12975:e311187347c1
1137 recoverymode = TRUE; 1137 recoverymode = TRUE;
1138 called_from_main = (curbuf->b_ml.ml_mfp == NULL); 1138 called_from_main = (curbuf->b_ml.ml_mfp == NULL);
1139 attr = HL_ATTR(HLF_E); 1139 attr = HL_ATTR(HLF_E);
1140 1140
1141 /* 1141 /*
1142 * If the file name ends in ".s[uvw][a-z]" we assume this is the swap file. 1142 * If the file name ends in ".s[a-w][a-z]" we assume this is the swap file.
1143 * Otherwise a search is done to find the swap file(s). 1143 * Otherwise a search is done to find the swap file(s).
1144 */ 1144 */
1145 fname = curbuf->b_fname; 1145 fname = curbuf->b_fname;
1146 if (fname == NULL) /* When there is no file name */ 1146 if (fname == NULL) /* When there is no file name */
1147 fname = (char_u *)""; 1147 fname = (char_u *)"";
1151 STRNICMP(fname + len - 4, "_s", 2) 1151 STRNICMP(fname + len - 4, "_s", 2)
1152 #else 1152 #else
1153 STRNICMP(fname + len - 4, ".s", 2) 1153 STRNICMP(fname + len - 4, ".s", 2)
1154 #endif 1154 #endif
1155 == 0 1155 == 0
1156 && vim_strchr((char_u *)"UVWuvw", fname[len - 2]) != NULL 1156 && vim_strchr((char_u *)"abcdefghijklmnopqrstuvw",
1157 TOLOWER_ASC(fname[len - 2])) != NULL
1157 && ASCII_ISALPHA(fname[len - 1])) 1158 && ASCII_ISALPHA(fname[len - 1]))
1158 { 1159 {
1159 directly = TRUE; 1160 directly = TRUE;
1160 fname_used = vim_strsave(fname); /* make a copy for mf_open() */ 1161 fname_used = vim_strsave(fname); /* make a copy for mf_open() */
1161 } 1162 }