summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-02-17 22:53:14 +0100
committerBram Moolenaar <Bram@vim.org>2020-02-17 22:53:14 +0100
commit1fa8d2c33d7290eda7dc2a94d4ec6a599a2d61dd (patch)
tree2e185859825be658eab3ae17b9ddfd399c2ebb8c /src
parent414b79662786762256e756ece8ab4aaecbbf9bd1 (diff)
patch 8.2.0273: MS-Windows uninstall may delete wrong batch filev8.2.0273
Problem: MS-Windows uninstall may delete wrong batch file. Solution: Add specific marker in the generated batch file. (Ken Takata, closes #5654)
Diffstat (limited to 'src')
-rw-r--r--src/Make_mvc.mak2
-rw-r--r--src/dosinst.c1
-rw-r--r--src/dosinst.h3
-rw-r--r--src/uninstall.c17
-rw-r--r--src/version.c2
5 files changed, 12 insertions, 13 deletions
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index fd7a6ab5c3..6076dc172e 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -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 \
diff --git a/src/dosinst.c b/src/dosinst.c
index 2ded88ef3b..6ce40439a0 100644
--- a/src/dosinst.c
+++ b/src/dosinst.c
@@ -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");
diff --git a/src/dosinst.h b/src/dosinst.h
index a849dad907..c262c4224b 100644
--- a/src/dosinst.h
+++ b/src/dosinst.h
@@ -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,
diff --git a/src/uninstall.c b/src/uninstall.c
index ef0538a140..e9a9aac327 100644
--- a/src/uninstall.c
+++ b/src/uninstall.c
@@ -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);
}
diff --git a/src/version.c b/src/version.c
index 1008eaf1e6..2fbccd29a2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -739,6 +739,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 273,
+/**/
272,
/**/
271,