On Wed, Jan 14, 2009 at 6:51 PM, Yasuhiro MATSUMOTO <mattn...@gmail.com> wrote: > On Wed, Jan 14, 2009 at 5:55 PM, Tony Mechelynck > <antoine.mechely...@gmail.com> wrote: >> >> On 14/01/09 03:03, Yasuhiro MATSUMOTO wrote: >>> Hi all. >>> >>> It seems that quoting arguments of shebang command depend on shellslash. >>> but on windows, cmd.exe or command.com can't treat single quote. >>> >>> --- test.vimrc --- >>> set nocompatible >>> set shellslash >>> ---------------------- >>> >> >> cmd.exe and command.com also can't handle the forward slash as a path >> separator, so you shouldn't set 'sellslash' if you're using them. The >> single quote is to be used when using a Unix-like shell on Windows (and, >> unlike what you seem to be assuming, a Unix-like shell can be used on >> top of cmd.exe or command.com, in which case $COMSPEC will be set to the >> Dos/Windows shell, not the Unix-like shell). > > Hmm. > No. cmd.exe can treat the forward slash as path separator. And > shellslash had working good on windows with older version. > I guess this is a bug or grade down. > still more, netrw can't treat shellshash correctly on latest version. > > :e http://www.google.com/ > > the buffer name will be broken like a following with noshellslash. > > http:\\www.google.com\ > > Many users hope to use shellslash on windows.
Or how about below? (check that COMSPEC is cmd.exe) Index: src/misc2.c =================================================================== --- src/misc2.c (revision 1318) +++ src/misc2.c (working copy) @@ -1286,7 +1286,19 @@ char_u *escaped_string; int l; int csh_like; + int ssl = p_ssl; +# if defined(WIN32) || defined(WIN16) || defined(DOS) + /* cmd.exe or command.com can't treat single quote. */ + char_u *comspec; + + comspec = mch_getenv("COMSPEC"); + if (comspec && STRICMP((char *)gettail(comspec), "cmd.exe") == 0 + && STRNCMP(comspec, p_sh, STRLEN(comspec)) == 0) { + ssl = 0; + } +#endif + /* Only csh and similar shells expand '!' within single quotes. For sh and * the like we must not put a backslash before it, it will be taken * literally. If do_special is set the '!' will be escaped twice. @@ -1298,7 +1310,7 @@ for (p = string; *p != NUL; mb_ptr_adv(p)) { # if defined(WIN32) || defined(WIN16) || defined(DOS) - if (!p_ssl) + if (!ssl) { if (*p == '"') ++length; /* " -> "" */ @@ -1328,7 +1340,7 @@ /* add opening quote */ # if defined(WIN32) || defined(WIN16) || defined(DOS) - if (!p_ssl) + if (!ssl) *d++ = '"'; else # endif @@ -1337,7 +1349,7 @@ for (p = string; *p != NUL; ) { # if defined(WIN32) || defined(WIN16) || defined(DOS) - if (!p_ssl) + if (!ssl) { if (*p == '"') { @@ -1378,7 +1390,7 @@ /* add terminating quote and finish with a NUL */ # if defined(WIN32) || defined(WIN16) || defined(DOS) - if (!p_ssl) + if (!ssl) *d++ = '"'; else # endif -- - Yasuhiro Matsumoto --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---