]> granicus.if.org Git - vim/commitdiff
patch 8.0.0876: backslashes and wildcards in backticks don't work v8.0.0876
authorBram Moolenaar <Bram@vim.org>
Sat, 5 Aug 2017 21:09:31 +0000 (23:09 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 5 Aug 2017 21:09:31 +0000 (23:09 +0200)
Problem:    MS-Windows: Backslashes and wildcards in backticks don't work.
Solution:   Do not handle backslashes inside backticks in the wrong place.
            (Yasuhiro Matsumoto, closes #1942)

src/os_mswin.c
src/os_win32.c
src/version.c

index dd420122248f6092c14bd82c81de52a7d86aa314..374a2399c566991c2d7d3625903c8f2e1dc3bf85 100644 (file)
@@ -450,6 +450,15 @@ slash_adjust(char_u *p)
 {
     if (path_with_url(p))
        return;
+
+    if (*p == '`')
+    {
+       /* don't replace backslash in backtick quoted strings */
+       int len = STRLEN(p);
+       if (len > 2 && *(p + len - 1) == '`')
+           return;
+    }
+
     while (*p)
     {
        if (*p == psepcN)
index f75040c11f3e3c56c57ee7899ebbb7cc38b591a3..6c1a3dbdef59b4a145508e88c24f8aa16c4cde4d 100644 (file)
@@ -7004,6 +7004,8 @@ fix_arg_enc(void)
        str = utf16_to_enc(ArglistW[idx], NULL);
        if (str != NULL)
        {
+           int literal = used_file_literal;
+
 #ifdef FEAT_DIFF
            /* When using diff mode may need to concatenate file name to
             * directory name.  Just like it's done in main(). */
@@ -7025,7 +7027,15 @@ fix_arg_enc(void)
            if (used_file_literal)
                buf_set_name(fnum_list[i], str);
 
-           alist_add(&global_alist, str, used_file_literal ? 2 : 0);
+           /* Check backtick literal. backtick literal is already expanded in
+            * main.c, so this part add str as literal. */
+           if (literal == FALSE)
+           {
+               int len = STRLEN(str);
+               if (len > 2 && *str == '`' && *(str + len - 1) == '`')
+                   literal = TRUE;
+           }
+           alist_add(&global_alist, str, literal ? 2 : 0);
        }
     }
 
index da594f762ba0953858fbac90457bc578a56c336a..5c64a70319732d40009bd332adaa56d4da56f0e2 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    876,
 /**/
     875,
 /**/