From 33aec765bdc2096f123c5a4c61f8948a61aa9ef5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sun, 22 Jan 2006 23:30:12 +0000 Subject: updated for version 7.0185 --- src/dosinst.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'src/dosinst.c') diff --git a/src/dosinst.c b/src/dosinst.c index efc6fdfee0..41a826708c 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 =~ '\\ ' . 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 =~ '\\ ' . arg3 . eq\n"); + fprintf(fd, "endfunction\n"); fprintf(fd, "\n"); } -- cgit v1.2.3