To: vim-dev@vim.org Subject: Patch 6.2.341 (extra) Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.341 (extra) Problem: Win32: When the path to diff.exe contains a space and using the vimrc generated by the install program, diff mode does not work. Solution: Put the first double quote just before the space instead of before the path. Files: src/dosinst.c *** ../vim-6.2.340/src/dosinst.c Fri Jul 25 22:43:59 2003 --- src/dosinst.c Wed Mar 10 12:42:30 2004 *************** *** 1122,1127 **** --- 1122,1128 ---- { FILE *fd, *tfd; char *fname; + char *p; /* If an old vimrc file exists, overwrite it. * Otherwise create a new one. */ *************** *** 1176,1186 **** 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 here if the path includes a space. */ ! if (strchr(installdir, ' ') != NULL) ! fprintf(fd, " silent execute '!\"%s\\diff\" -a ' . opt . '\"' . v:fname_in . '\" \"' . v:fname_new . '\" > \"' . v:fname_out . '\"'\n", installdir); else ! fprintf(fd, " silent execute '!%s\\diff -a ' . opt . '\"' . v:fname_in . '\" \"' . v:fname_new . '\" > \"' . v:fname_out . '\"'\n", installdir); fprintf(fd, "endfunction\n"); fprintf(fd, "\n"); } --- 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"); } *** ../vim-6.2.340/src/version.c Thu Mar 11 17:48:22 2004 --- src/version.c Thu Mar 11 20:45:16 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 341, /**/ -- hundred-and-one symptoms of being an internet addict: 4. Your eyeglasses have a web site burned in on them. /// 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 ///