mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -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:
parent
414b796627
commit
1fa8d2c33d
@ -1359,7 +1359,7 @@ $(VIM): $(VIM).exe
|
||||
$(OUTDIR):
|
||||
if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
|
||||
|
||||
CFLAGS_INST = /nologo -DNDEBUG -DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) $(CFLAGS_DEPR)
|
||||
CFLAGS_INST = /nologo /O2 -DNDEBUG -DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) $(CFLAGS_DEPR)
|
||||
|
||||
install.exe: dosinst.c dosinst.h version.h
|
||||
$(CC) $(CFLAGS_INST) dosinst.c kernel32.lib shell32.lib \
|
||||
|
@ -841,6 +841,7 @@ install_bat_choice(int idx)
|
||||
|
||||
fprintf(fd, "@echo off\n");
|
||||
fprintf(fd, "rem -- Run Vim --\n");
|
||||
fprintf(fd, VIMBAT_UNINSTKEY "\n");
|
||||
fprintf(fd, "\n");
|
||||
fprintf(fd, "setlocal\n");
|
||||
|
||||
|
@ -354,6 +354,9 @@ struct
|
||||
"vimtutor.bat", "vimtutor.bat", ""},
|
||||
};
|
||||
|
||||
/* Uninstall key for vim.bat, etc. */
|
||||
#define VIMBAT_UNINSTKEY "rem # uninstall key: " VIM_VERSION_NODOT " #"
|
||||
|
||||
#define ICON_COUNT 3
|
||||
char *(icon_names[ICON_COUNT]) =
|
||||
{"gVim " VIM_VERSION_SHORT,
|
||||
|
@ -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]))
|
||||
if (strncmp(line, VIMBAT_UNINSTKEY, key_len) == 0)
|
||||
{
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
if (found)
|
||||
break;
|
||||
}
|
||||
fclose(fd);
|
||||
}
|
||||
|
@ -738,6 +738,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
273,
|
||||
/**/
|
||||
272,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user