To: vim-dev@vim.org Subject: Patch 6.2.429 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.429 Problem: Unix: glob() doesn't work for a directory with a single quote in the name. (Nazri Ramliy) Solution: When using the shell to expand, only put double quotes around spaces and single quotes, not the whole thing. Files: src/os_unix.c *** ../vim-6.2.428/src/os_unix.c Tue Mar 30 21:52:46 2004 --- src/os_unix.c Fri Apr 2 14:31:45 2004 *************** *** 4755,4776 **** for (i = 0; i < num_pat; ++i) { /* When using system() always add extra quotes, because the shell ! * is started twice. Otherwise it's only needed when the pattern ! * includes spaces or single quotes. */ ! #ifndef USE_SYSTEM ! if (vim_strpbrk(pat[i], " '") != NULL) ! #endif ! { ! STRCAT(command, " \""); ! STRCAT(command, pat[i]); ! STRCAT(command, "\""); ! } ! #ifndef USE_SYSTEM ! else ! { ! STRCAT(command, " "); ! STRCAT(command, pat[i]); ! } #endif } if (flags & EW_SILENT) --- 4755,4781 ---- for (i = 0; i < num_pat; ++i) { /* When using system() always add extra quotes, because the shell ! * is started twice. Otherwise only put quotes around spaces and ! * single quotes. */ ! #ifdef USE_SYSTEM ! STRCAT(command, " \""); ! STRCAT(command, pat[i]); ! STRCAT(command, "\""); ! #else ! p = command + STRLEN(command); ! *p++ = ' '; ! for (j = 0; pat[i][j] != NUL; ) ! if (vim_strchr((char_u *)" '", pat[i][j]) != NULL) ! { ! *p++ = '"'; ! while (pat[i][j] != NUL ! && vim_strchr((char_u *)" '", pat[i][j]) != NULL) ! *p++ = pat[i][j++]; ! *p++ = '"'; ! } ! else ! *p++ = pat[i][j++]; ! *p = NUL; #endif } if (flags & EW_SILENT) *** ../vim-6.2.428/src/version.c Fri Apr 2 14:07:44 2004 --- src/version.c Fri Apr 2 14:40:26 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 429, /**/ -- hundred-and-one symptoms of being an internet addict: 239. You think "surfing" is something you do on dry land. /// 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 ///