Hi list. I'm having this issue for long time. I want to use shellshash on windows. Because some GNU's win32 utilities are not work correctly with including backslash in the path. And I remember: that Vim was working cheerfully with set shellslash on windows. Perhaps become at version 7.0, I couldn't use shellshash on windows on a sudden.
if set shellslash, "shellescape()" quote the arguments with single quote. The arguments for external command became to quote as single quote. i.e., I lost the way to use shellslash for passing double quoted arguments. To make matters worse, I get an error with doing following. :e http://www.google.com/ :!curl 'http://www.google.com/' -o 'C:/DOCUME~1/MATTN/Temp/ VIA2046.tmp' curl: (1) Unsupported protocol: 'http And I'll look that buffer name will be following. http:\\www.google.com\ Few months ago, I posted few suggestion about fixing this problem. But it was not solved. I tried to change to use noshellshash in my vimrc repeatedly. but I couldn't be love it. So I want to suggest to fix this again. By and large, most user is using cmd.exe (or command.com) on windows. This is meaning that Vim should escape double quote to pass the arguments for command. However, currently Vim interpret shellslash option against whether should use single or double quote. This is not right. This should be checked whether a 'shell' option contain 'sh'. (same as shellxquote option) Please check this patch. - Yasuhiro Matsumoto diff -r 1ccc1ace9e5b src/misc2.c --- a/src/misc2.c Wed Nov 03 22:32:24 2010 +0100 +++ b/src/misc2.c Wed Nov 10 20:54:26 2010 +0900 @@ -1359,6 +1359,9 @@ char_u *escaped_string; int l; int csh_like; +# if defined(WIN32) || defined(WIN16) || defined(DOS) + int using_command_prompt = !p_ssl || *p_sxq == NUL; +# 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 @@ -1371,7 +1374,7 @@ for (p = string; *p != NUL; mb_ptr_adv(p)) { # if defined(WIN32) || defined(WIN16) || defined(DOS) - if (!p_ssl) + if (using_command_prompt) { if (*p == '"') ++length; /* " -> "" */ @@ -1401,7 +1404,7 @@ /* add opening quote */ # if defined(WIN32) || defined(WIN16) || defined(DOS) - if (!p_ssl) + if (using_command_prompt) *d++ = '"'; else # endif @@ -1410,7 +1413,7 @@ for (p = string; *p != NUL; ) { # if defined(WIN32) || defined(WIN16) || defined(DOS) - if (!p_ssl) + if (using_command_prompt) { if (*p == '"') { @@ -1452,7 +1455,7 @@ /* add terminating quote and finish with a NUL */ # if defined(WIN32) || defined(WIN16) || defined(DOS) - if (!p_ssl) + if (using_command_prompt) *d++ = '"'; else # endif -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
