Skip to content

Commit 8c88733

Browse files
committed
updated for version 7.4.103
Problem: Dos installer uses an old way to escape spaces in the diff command. Solution: Adjust the quoting to the new default shellxquote. (Ben Fritz)
1 parent 167dc3c commit 8c88733

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/dosinst.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,23 +1192,29 @@ install_vimrc(int idx)
11921192
fprintf(fd, " if arg3 =~ ' ' | let arg3 = '\"' . arg3 . '\"' | endif\n");
11931193

11941194
/* If the path has a space: When using cmd.exe (Win NT/2000/XP) put
1195-
* quotes around the whole command and around the diff command.
1195+
* quotes around the diff command and rely on the default value of
1196+
* shellxquote to solve the quoting problem for the whole command.
1197+
*
11961198
* Otherwise put a double quote just before the space and at the
11971199
* end of the command. Putting quotes around the whole thing
11981200
* doesn't work on Win 95/98/ME. This is mostly guessed! */
1199-
fprintf(fd, " let eq = ''\n");
12001201
fprintf(fd, " if $VIMRUNTIME =~ ' '\n");
12011202
fprintf(fd, " if &sh =~ '\\<cmd'\n");
1202-
fprintf(fd, " let cmd = '\"\"' . $VIMRUNTIME . '\\diff\"'\n");
1203-
fprintf(fd, " let eq = '\"'\n");
1203+
fprintf(fd, " if empty(&shellxquote)\n");
1204+
fprintf(fd, " let l:shxq_sav = ''\n");
1205+
fprintf(fd, " set shellxquote&\n");
1206+
fprintf(fd, " endif\n");
1207+
fprintf(fd, " let cmd = '\"' . $VIMRUNTIME . '\\diff\"'\n");
12041208
fprintf(fd, " else\n");
12051209
fprintf(fd, " let cmd = substitute($VIMRUNTIME, ' ', '\" ', '') . '\\diff\"'\n");
12061210
fprintf(fd, " endif\n");
12071211
fprintf(fd, " else\n");
12081212
fprintf(fd, " let cmd = $VIMRUNTIME . '\\diff'\n");
12091213
fprintf(fd, " endif\n");
1210-
fprintf(fd, " silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq\n");
1211-
1214+
fprintf(fd, " silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n");
1215+
fprintf(fd, " if exists('l:shxq_sav')\n");
1216+
fprintf(fd, " let &shellxquote=l:shxq_sav\n");
1217+
fprintf(fd, " endif\n");
12121218
fprintf(fd, "endfunction\n");
12131219
fprintf(fd, "\n");
12141220
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ static char *(features[]) =
738738

739739
static int included_patches[] =
740740
{ /* Add new patch number below this line */
741+
/**/
742+
103,
741743
/**/
742744
102,
743745
/**/

0 commit comments

Comments
 (0)