To: vim-dev@vim.org Subject: Patch 6.2.370 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.370 (extra, after 6.2.341) Problem: Win32: When the path to diff.exe contains a space and using the vimrc generated by the install program, diff mode may not work. (Alejandro Lopez-Valencia) Solution: Do not use double quotes for arguments that do not have a space. Files: src/dosinst.c *** ../vim-6.2.369/src/dosinst.c Thu Mar 11 20:46:51 2004 --- src/dosinst.c Tue Mar 16 12:59:30 2004 *************** *** 1177,1196 **** fprintf(fd, " let opt = ''\n"); fprintf(fd, " if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif\n"); fprintf(fd, " if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif\n"); ! fprintf(fd, " silent execute '!"); p = strchr(installdir, ' '); if (p != NULL) { ! /* The path has a space. Put a double quote just before the space ! * and at the end of the command. Putting quotes around the whole ! * thing doesn't work. */ *p = NUL; ! fprintf(fd, "%s\" %s\\diff\"", installdir, p + 1); *p = ' '; } else ! fprintf(fd, "%s\\diff", installdir); ! fprintf(fd, " -a ' . opt . '\"' . v:fname_in . '\" \"' . v:fname_new . '\" > \"' . v:fname_out . '\"'\n"); fprintf(fd, "endfunction\n"); fprintf(fd, "\n"); } --- 1177,1207 ---- fprintf(fd, " let opt = ''\n"); fprintf(fd, " if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif\n"); fprintf(fd, " if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif\n"); ! /* Use quotes only when needed, they may cause trouble. */ ! fprintf(fd, " let arg1 = v:fname_in\n"); ! fprintf(fd, " if arg1 =~ ' ' | let arg1 = '\"' . arg1 . '\"' | endif\n"); ! fprintf(fd, " let arg2 = v:fname_new\n"); ! 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\" -a ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n", installdir, p + 1); *p = ' '; + fprintf(fd, " endif\n"); } else ! fprintf(fd, " silent execute '!%s\\diff -a ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n", installdir); fprintf(fd, "endfunction\n"); fprintf(fd, "\n"); } *** ../vim-6.2.369/src/version.c Wed Mar 17 14:08:56 2004 --- src/version.c Wed Mar 17 15:16:56 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 370, /**/ -- Light travels faster than sound. This is why some people appear bright until you hear them speak /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///