summaryrefslogtreecommitdiff
path: root/src/dosinst.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-01-22 23:30:12 +0000
committerBram Moolenaar <Bram@vim.org>2006-01-22 23:30:12 +0000
commit33aec765bdc2096f123c5a4c61f8948a61aa9ef5 (patch)
tree858b75b899a2ed6cf6e5543a1f29201c04650bd4 /src/dosinst.c
parent71fe80dddd436b36de5d814c1165a3e56b1f0974 (diff)
downloadvim-git-33aec765bdc2096f123c5a4c61f8948a61aa9ef5.tar.gz
updated for version 7.0185v7.0185
Diffstat (limited to 'src/dosinst.c')
-rw-r--r--src/dosinst.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/src/dosinst.c b/src/dosinst.c
index efc6fdfee..41a826708 100644
--- a/src/dosinst.c
+++ b/src/dosinst.c
@@ -1194,24 +1194,25 @@ install_vimrc(int idx)
fprintf(fd, " if arg2 =~ ' ' | let arg2 = '\"' . arg2 . '\"' | endif\n");
fprintf(fd, " let arg3 = v:fname_out\n");
fprintf(fd, " if arg3 =~ ' ' | let arg3 = '\"' . arg3 . '\"' | endif\n");
- p = strchr(installdir, ' ');
- if (p != NULL)
- {
- /* The path has a space. When using cmd.exe (Win NT/2000/XP) put
- * quotes around the whole command and around the diff command.
- * Otherwise put a double quote just before the space and at the
- * end of the command. Putting quotes around the whole thing
- * doesn't work on Win 95/98/ME. This is mostly guessed! */
- fprintf(fd, " if &sh =~ '\\<cmd'\n");
- fprintf(fd, " silent execute '!\"\"%s\\diff\" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . '\"'\n", installdir);
- fprintf(fd, " else\n");
- *p = NUL;
- fprintf(fd, " silent execute '!%s\" %s\\diff\" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n", installdir, p + 1);
- *p = ' ';
- fprintf(fd, " endif\n");
- }
- else
- fprintf(fd, " silent execute '!%s\\diff ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n", installdir);
+
+ /* If the path has a space: When using cmd.exe (Win NT/2000/XP) put
+ * quotes around the whole command and around the diff command.
+ * Otherwise put a double quote just before the space and at the
+ * end of the command. Putting quotes around the whole thing
+ * doesn't work on Win 95/98/ME. This is mostly guessed! */
+ fprintf(fd, " let eq = ''\n");
+ fprintf(fd, " if $VIMRUNTIME =~ ' '\n");
+ fprintf(fd, " if &sh =~ '\\<cmd'\n");
+ fprintf(fd, " let cmd = '\"\"' . $VIMRUNTIME . '\\diff\"'\n");
+ fprintf(fd, " let eq = '\"'\n");
+ fprintf(fd, " else\n");
+ fprintf(fd, " let cmd = substitute($VIMRUNTIME, ' ', '\" ', '') . '\\diff\"'\n");
+ fprintf(fd, " endif\n");
+ fprintf(fd, " else\n");
+ fprintf(fd, " let cmd = $VIMRUNTIME . '\\diff'\n");
+ fprintf(fd, " endif\n");
+ fprintf(fd, " silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq\n");
+
fprintf(fd, "endfunction\n");
fprintf(fd, "\n");
}