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
----------------------

C:\> vim -u test.vimrc -U NONE
:e http://www.google.com/

I got empty buffer. it cause that vim call following command in
mch_call_shell().
----------------------
curl -o 'C:/DOCUME~1/MATSUM~1/LOCALS~1/Temp/VIAD5.tmp' 'http://www.google.com'

curl: (6) Could not resolve host: curl; Host not found
curl: (1) Unsupported protocol: 'http
----------------------

Below is a patch for fixing this problem. Please check and include.

Index: src/misc2.c
===================================================================
--- src/misc2.c (revision 1318)
+++ src/misc2.c (working copy)
@@ -1286,7 +1286,18 @@
     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 && 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 +1309,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 +1339,7 @@

        /* add opening quote */
 # if defined(WIN32) || defined(WIN16) || defined(DOS)
-       if (!p_ssl)
+       if (!ssl)
            *d++ = '"';
        else
 # endif
@@ -1337,7 +1348,7 @@
        for (p = string; *p != NUL; )
        {
 # if defined(WIN32) || defined(WIN16) || defined(DOS)
-           if (!p_ssl)
+           if (!ssl)
            {
                if (*p == '"')
                {
@@ -1378,7 +1389,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
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui