0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.0273: MS-Windows uninstall may delete wrong batch file

Problem:    MS-Windows uninstall may delete wrong batch file.
Solution:   Add specific marker in the generated batch file. (Ken Takata,
            closes #5654)
This commit is contained in:
Bram Moolenaar
2020-02-17 22:53:14 +01:00
parent 414b796627
commit 1fa8d2c33d
5 changed files with 12 additions and 13 deletions

View File

@@ -200,8 +200,7 @@ batfile_thisversion(char *path)
{
FILE *fd;
char line[BUFSIZE];
char *p;
int ver_len = strlen(VIM_VERSION_NODOT);
int key_len = strlen(VIMBAT_UNINSTKEY);
int found = FALSE;
fd = fopen(path, "r");
@@ -209,17 +208,11 @@ batfile_thisversion(char *path)
{
while (fgets(line, sizeof(line), fd) != NULL)
{
for (p = line; *p != 0; ++p)
// don't accept "vim60an" when looking for "vim60".
if (strnicmp(p, VIM_VERSION_NODOT, ver_len) == 0
&& !isdigit(p[ver_len])
&& !isalpha(p[ver_len]))
{
found = TRUE;
break;
}
if (found)
if (strncmp(line, VIMBAT_UNINSTKEY, key_len) == 0)
{
found = TRUE;
break;
}
}
fclose(fd);
}