• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revisão9800e126eaa23307109cb171f8ec4a78c1e8f8b1 (tree)
Hora2020-02-18 07:00:04
AutorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Mensagem de Log

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

Commit: https://github.com/vim/vim/commit/1fa8d2c33d7290eda7dc2a94d4ec6a599a2d61dd
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Feb 17 22:53:14 2020 +0100

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)

Mudança Sumário

Diff

diff -r f08b2ab4e1d0 -r 9800e126eaa2 src/Make_mvc.mak
--- a/src/Make_mvc.mak Mon Feb 17 22:45:04 2020 +0100
+++ b/src/Make_mvc.mak Mon Feb 17 23:00:04 2020 +0100
@@ -1359,7 +1359,7 @@
13591359 $(OUTDIR):
13601360 if not exist $(OUTDIR)/nul mkdir $(OUTDIR)
13611361
1362-CFLAGS_INST = /nologo -DNDEBUG -DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) $(CFLAGS_DEPR)
1362+CFLAGS_INST = /nologo /O2 -DNDEBUG -DWIN32 -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) $(CFLAGS_DEPR)
13631363
13641364 install.exe: dosinst.c dosinst.h version.h
13651365 $(CC) $(CFLAGS_INST) dosinst.c kernel32.lib shell32.lib \
diff -r f08b2ab4e1d0 -r 9800e126eaa2 src/dosinst.c
--- a/src/dosinst.c Mon Feb 17 22:45:04 2020 +0100
+++ b/src/dosinst.c Mon Feb 17 23:00:04 2020 +0100
@@ -841,6 +841,7 @@
841841
842842 fprintf(fd, "@echo off\n");
843843 fprintf(fd, "rem -- Run Vim --\n");
844+ fprintf(fd, VIMBAT_UNINSTKEY "\n");
844845 fprintf(fd, "\n");
845846 fprintf(fd, "setlocal\n");
846847
diff -r f08b2ab4e1d0 -r 9800e126eaa2 src/dosinst.h
--- a/src/dosinst.h Mon Feb 17 22:45:04 2020 +0100
+++ b/src/dosinst.h Mon Feb 17 23:00:04 2020 +0100
@@ -354,6 +354,9 @@
354354 "vimtutor.bat", "vimtutor.bat", ""},
355355 };
356356
357+/* Uninstall key for vim.bat, etc. */
358+#define VIMBAT_UNINSTKEY "rem # uninstall key: " VIM_VERSION_NODOT " #"
359+
357360 #define ICON_COUNT 3
358361 char *(icon_names[ICON_COUNT]) =
359362 {"gVim " VIM_VERSION_SHORT,
diff -r f08b2ab4e1d0 -r 9800e126eaa2 src/uninstall.c
--- a/src/uninstall.c Mon Feb 17 22:45:04 2020 +0100
+++ b/src/uninstall.c Mon Feb 17 23:00:04 2020 +0100
@@ -200,8 +200,7 @@
200200 {
201201 FILE *fd;
202202 char line[BUFSIZE];
203- char *p;
204- int ver_len = strlen(VIM_VERSION_NODOT);
203+ int key_len = strlen(VIMBAT_UNINSTKEY);
205204 int found = FALSE;
206205
207206 fd = fopen(path, "r");
@@ -209,17 +208,11 @@
209208 {
210209 while (fgets(line, sizeof(line), fd) != NULL)
211210 {
212- for (p = line; *p != 0; ++p)
213- // don't accept "vim60an" when looking for "vim60".
214- if (strnicmp(p, VIM_VERSION_NODOT, ver_len) == 0
215- && !isdigit(p[ver_len])
216- && !isalpha(p[ver_len]))
217- {
218- found = TRUE;
219- break;
220- }
221- if (found)
211+ if (strncmp(line, VIMBAT_UNINSTKEY, key_len) == 0)
212+ {
213+ found = TRUE;
222214 break;
215+ }
223216 }
224217 fclose(fd);
225218 }
diff -r f08b2ab4e1d0 -r 9800e126eaa2 src/version.c
--- a/src/version.c Mon Feb 17 22:45:04 2020 +0100
+++ b/src/version.c Mon Feb 17 23:00:04 2020 +0100
@@ -739,6 +739,8 @@
739739 static int included_patches[] =
740740 { /* Add new patch number below this line */
741741 /**/
742+ 273,
743+/**/
742744 272,
743745 /**/
744746 271,
Show on old repository browser