To: [email protected]
Subject: Patch 6.1b.001
Fcc: outbox
From: Bram Moolenaar <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 6.1b.001 (extra)
Problem:    Checking for wildcards in a path does not handle multi-byte
           characters with a trail byte which is a wildcard.
Solution:   Handle multi-byte characters correctly. (Muraoka Taro)
Files:      src/os_amiga.c, src/os_mac.c, src/os_msdos.c, src/os_mswin.c,
           src/os_unix.c


*** ../vim-6.1b/src/os_amiga.c  Sun Mar 10 18:13:49 2002
--- src/os_amiga.c      Mon Mar 11 21:48:28 2002
***************
*** 1492,1500 ****
     {
       if (*p == '\\' && p[1] != NUL)
           ++p;
!       else
!           if (vim_strchr((char_u *)"*?[(#", *p) != NULL)
!               return TRUE;
     }
     return FALSE;
 }
--- 1492,1503 ----
     {
       if (*p == '\\' && p[1] != NUL)
           ++p;
!       else if (vim_strchr((char_u *)"*?[(#", *p) != NULL)
!           return TRUE;
! #ifdef FEAT_MBYTE
!       if (has_mbyte)
!           p += (*mb_ptr2len_check)(p) - 1;
! #endif
     }
     return FALSE;
 }
***************
*** 1517,1522 ****
--- 1520,1529 ----
                                               , *p) != NULL
                   || (*p == '~' && p[1] != NUL))
               return TRUE;
+ #ifdef FEAT_MBYTE
+       if (has_mbyte)
+           p += (*mb_ptr2len_check)(p) - 1;
+ #endif
     }
     return FALSE;
 }
*** ../vim-6.1b/src/os_mac.c    Sun Mar 10 18:13:48 2002
--- src/os_mac.c        Mon Mar 11 21:45:08 2002
***************
*** 1205,1210 ****
--- 1205,1214 ----
           ++p;
       else if (vim_strchr((char_u *)WILDCHAR_LIST, *p) != NULL)
           return TRUE;
+ #ifdef FEAT_MBYTE
+       if (has_mbyte)
+           p += (*mb_ptr2len_check)(p) - 1;
+ #endif
     }
     return FALSE;
 }
*** ../vim-6.1b/src/os_msdos.c  Sun Mar 10 18:13:49 2002
--- src/os_msdos.c      Mon Mar 11 21:46:29 2002
***************
*** 2190,2195 ****
--- 2190,2199 ----
       if (vim_strchr((char_u *)"?*[", *p) != NULL
               || (*p == '~' && p[1] != NUL))
           return TRUE;
+ #ifdef FEAT_MBYTE
+       if (has_mbyte)
+           p += (*mb_ptr2len_check)(p) - 1;
+ #endif
     }
     return FALSE;
 }
***************
*** 2212,2217 ****
--- 2216,2225 ----
                                               , *p) != NULL
               || (*p == '~' && p[1] != NUL))
           return TRUE;
+ #ifdef FEAT_MBYTE
+       if (has_mbyte)
+           p += (*mb_ptr2len_check)(p) - 1;
+ #endif
     }
     return FALSE;
 }
*** ../vim-6.1b/src/os_mswin.c  Sun Mar 10 18:13:50 2002
--- src/os_mswin.c      Mon Mar 11 21:46:49 2002
***************
*** 526,531 ****
--- 526,535 ----
       if (vim_strchr((char_u *)"?*[", *p) != NULL
               || (*p == '~' && p[1] != NUL))
           return TRUE;
+ #ifdef FEAT_MBYTE
+       if (has_mbyte)
+           p += (*mb_ptr2len_check)(p) - 1;
+ #endif
     }
     return FALSE;
 }
***************
*** 548,553 ****
--- 552,561 ----
                                               , *p) != NULL
               || (*p == '~' && p[1] != NUL))
           return TRUE;
+ #ifdef FEAT_MBYTE
+       if (has_mbyte)
+           p += (*mb_ptr2len_check)(p) - 1;
+ #endif
     }
     return FALSE;
 }
*** ../vim-6.1b/src/os_unix.c   Sun Mar 10 18:13:49 2002
--- src/os_unix.c       Mon Mar 11 21:47:41 2002
***************
*** 4754,4759 ****
--- 4754,4763 ----
 #endif
                                               , *p) != NULL)
           return TRUE;
+ #ifdef FEAT_MBYTE
+       if (has_mbyte)
+           p += (*mb_ptr2len_check)(p) - 1;
+ #endif
     }
     return FALSE;
 }
***************
*** 4790,4795 ****
--- 4794,4803 ----
                                               , *p) != NULL
               || (*p == '~' && p[1] != NUL))
           return TRUE;
+ #ifdef FEAT_MBYTE
+       if (has_mbyte)
+           p += (*mb_ptr2len_check)(p) - 1;
+ #endif
     }
     return FALSE;
 }
*** ../vim-6.1b/src/version.c   Sun Mar 10 18:13:49 2002
--- src/version.c       Mon Mar 11 21:51:04 2002
***************
*** 608,609 ****
--- 608,611 ----
 {   /* Add new patch number below this line */
+ /**/
+     1,
 /**/

--
hundred-and-one symptoms of being an internet addict:
248. You sign your letters with your e-mail address instead of your name.

///  Bram Moolenaar -- [email protected] -- http://www.moolenaar.net  \\\
///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
\\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///