job_start quote with double-quote even though no needed.

    job_start("cmd", "/c", "dir *.c")

This should be

    cmd /c "dir *.c"

But

    "cmd" "/c" "dir *.c"

All arguments are quoted.


diff --git a/src/eval.c b/src/eval.c
index a208b2a..ab4e8ff 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -15139,11 +15139,16 @@ f_job_start(typval_T *argvars UNUSED, typval_T *rettv)
 #else
            if (li != l->lv_first)
            {
-               s = vim_strsave_shellescape(s, FALSE, TRUE);
-               if (s == NULL)
-                   goto theend;
-               ga_concat(&ga, s);
-               vim_free(s);
+               if (vim_strpbrk(s, (char_u *)" \t\"") != NULL)
+               {
+                   s = vim_strsave_shellescape(s, FALSE, TRUE);
+                   if (s == NULL)
+                       goto theend;
+                   ga_concat(&ga, s);
+                   vim_free(s);
+               }
+               else
+                   ga_concat(&ga, s);
            }
            else
                ga_concat(&ga, s);

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui