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)
diff --git a/src/spellfile.c b/src/spellfile.c
index 2616afb..00c72f6 100644
--- a/src/spellfile.c
+++ b/src/spellfile.c
@@ -1734,7 +1734,7 @@
for (slang = first_lang; slang != NULL; slang = slang->sl_next)
{
- if (fullpathcmp(fname, slang->sl_fname, FALSE) == FPC_SAME)
+ if (fullpathcmp(fname, slang->sl_fname, FALSE, TRUE) == FPC_SAME)
{
slang_clear(slang);
if (spell_load_file(fname, NULL, slang, FALSE) == NULL)
@@ -5440,7 +5440,7 @@
* It might have been done already by spell_reload_one().
*/
for (slang = first_lang; slang != NULL; slang = slang->sl_next)
- if (fullpathcmp(wfname, slang->sl_fname, FALSE) == FPC_SAME)
+ if (fullpathcmp(wfname, slang->sl_fname, FALSE, TRUE) == FPC_SAME)
break;
if (slang == NULL)
{