]> granicus.if.org Git - vim/commitdiff
updated for version 7.1-081 v7.1.081
authorBram Moolenaar <Bram@vim.org>
Sat, 18 Aug 2007 15:47:34 +0000 (15:47 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 18 Aug 2007 15:47:34 +0000 (15:47 +0000)
src/ex_docmd.c
src/version.c

index 5e6379197edc301a47675e32191d55bf0e05c873..73a990c7259042b7eb4e1baf5bd8844fb5715f92 100644 (file)
@@ -3281,39 +3281,64 @@ set_one_cmd_context(xp, buff)
 
     if (ea.argt & XFILE)
     {
-       int in_quote = FALSE;
-       char_u *bow = NULL;     /* Beginning of word */
+       int     c;
+       int     in_quote = FALSE;
+       char_u  *bow = NULL;    /* Beginning of word */
 
        /*
         * Allow spaces within back-quotes to count as part of the argument
         * being expanded.
         */
        xp->xp_pattern = skipwhite(arg);
-       for (p = xp->xp_pattern; *p; )
+       p = xp->xp_pattern;
+       while (*p != NUL)
        {
-           if (*p == '\\' && p[1] != NUL)
+#ifdef FEAT_MBYTE
+           if (has_mbyte)
+               c = mb_ptr2char(p);
+           else
+#endif
+               c = *p;
+           if (c == '\\' && p[1] != NUL)
                ++p;
+           else if (c == '`')
+           {
+               if (!in_quote)
+               {
+                   xp->xp_pattern = p;
+                   bow = p + 1;
+               }
+               in_quote = !in_quote;
+           }
 #ifdef SPACE_IN_FILENAME
-           else if (vim_iswhite(*p) && (!(ea.argt & NOSPC) || usefilter))
+           else if (!vim_isfilec(c) && (!(ea.argt & NOSPC) || usefilter))
 #else
-           else if (vim_iswhite(*p))
+           else if (!vim_isfilec(c))
 #endif
            {
-               p = skipwhite(p);
+               while (*p != NUL)
+               {
+#ifdef FEAT_MBYTE
+                   if (has_mbyte)
+                       c = mb_ptr2char(p);
+                   else
+#endif
+                       c = *p;
+                   if (c == '`' || vim_isfilec(c))
+                       break;
+#ifdef FEAT_MBYTE
+                   if (has_mbyte)
+                       len = (*mb_ptr2len)(p);
+                   else
+#endif
+                       len = 1;
+                   mb_ptr_adv(p);
+               }
                if (in_quote)
                    bow = p;
                else
                    xp->xp_pattern = p;
-               --p;
-           }
-           else if (*p == '`')
-           {
-               if (!in_quote)
-               {
-                   xp->xp_pattern = p;
-                   bow = p + 1;
-               }
-               in_quote = !in_quote;
+               p -= len;
            }
            mb_ptr_adv(p);
        }
index 33bbc7d9be92e2bbf3ee17645297840cf3948269..336976eaff9baaad237ba2b4a57e3cf6d31834c7 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    81,
 /**/
     80,
 /**/