patch 7.4.1820
Problem: Removing language from help tags too often.
Solution: Only remove @en when not needed. (Hirohito Higashi)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 26fed59..ed9707a 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4519,25 +4519,32 @@
len = (int)STRLEN(file[i]) - 3;
if (len <= 0)
continue;
- if (STRCMP(file[i] + len, buf) == 0)
- {
- /* remove the default language */
- file[i][len] = NUL;
- }
- else if (STRCMP(file[i] + len, "@en") == 0)
+ if (STRCMP(file[i] + len, "@en") == 0)
{
/* Sorting on priority means the same item in another language may
* be anywhere. Search all items for a match up to the "@en". */
for (j = 0; j < num_file; ++j)
- if (j != i
- && (int)STRLEN(file[j]) == len + 3
- && STRNCMP(file[i], file[j], len + 1) == 0)
+ if (j != i && (int)STRLEN(file[j]) == len + 3
+ && STRNCMP(file[i], file[j], len + 1) == 0)
break;
if (j == num_file)
/* item only exists with @en, remove it */
file[i][len] = NUL;
}
}
+
+ if (*buf != NUL)
+ for (i = 0; i < num_file; ++i)
+ {
+ len = (int)STRLEN(file[i]) - 3;
+ if (len <= 0)
+ continue;
+ if (STRCMP(file[i] + len, buf) == 0)
+ {
+ /* remove the default language */
+ file[i][len] = NUL;
+ }
+ }
}
#endif