| To: vim_dev@googlegroups.com |
| Subject: Patch 7.3.888 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| ------------ |
| |
| Patch 7.3.888 |
| Problem: Filename completion with 'fileignorecase' does not work for |
| multi-byte characters. |
| Solution: Make 'fileignorecase' work properly. (Hirohito Higashi) |
| Files: src/misc2.c |
| |
| |
| *** ../vim-7.3.887/src/misc2.c 2013-03-19 18:31:45.000000000 +0100 |
| --- src/misc2.c 2013-04-12 14:15:03.000000000 +0200 |
| *************** |
| *** 6099,6150 **** |
| int maxlen; |
| { |
| int i; |
| const char *s = NULL; |
| |
| ! for (i = 0; maxlen < 0 || i < maxlen; ++i) |
| { |
| |
| ! if (p[i] == NUL) |
| { |
| ! if (q[i] == NUL) |
| return 0; |
| s = q; |
| break; |
| } |
| |
| |
| ! if (q[i] == NUL) |
| { |
| s = p; |
| break; |
| } |
| |
| ! if ((p_fic ? TOUPPER_LOC(p[i]) != TOUPPER_LOC(q[i]) : p[i] != q[i]) |
| |
| |
| ! && !((p[i] == '/' && q[i] == '\\') |
| ! || (p[i] == '\\' && q[i] == '/')) |
| |
| ) |
| { |
| ! if (vim_ispathsep(p[i])) |
| return -1; |
| ! if (vim_ispathsep(q[i])) |
| return 1; |
| ! return ((char_u *)p)[i] - ((char_u *)q)[i]; |
| } |
| } |
| if (s == NULL) |
| return 0; |
| |
| |
| ! if (s[i + 1] == NUL |
| && i > 0 |
| && !after_pathsep((char_u *)s, (char_u *)s + i) |
| |
| ! && (s[i] == '/' || s[i] == '\\') |
| |
| ! && s[i] == '/' |
| |
| ) |
| return 0; |
| --- 6099,6157 ---- |
| int maxlen; |
| { |
| int i; |
| + int c1, c2; |
| const char *s = NULL; |
| |
| ! for (i = 0; maxlen < 0 || i < maxlen; i += MB_PTR2LEN((char_u *)p + i)) |
| { |
| + c1 = PTR2CHAR((char_u *)p + i); |
| + c2 = PTR2CHAR((char_u *)q + i); |
| + |
| |
| ! if (c1 == NUL) |
| { |
| ! if (c2 == NUL) |
| return 0; |
| s = q; |
| break; |
| } |
| |
| |
| ! if (c2 == NUL) |
| { |
| s = p; |
| break; |
| } |
| |
| ! if ((p_fic ? MB_TOUPPER(c1) != MB_TOUPPER(c2) : c1 != c2) |
| |
| |
| ! && !((c1 == '/' && c2 == '\\') |
| ! || (c1 == '\\' && c2 == '/')) |
| |
| ) |
| { |
| ! if (vim_ispathsep(c1)) |
| return -1; |
| ! if (vim_ispathsep(c2)) |
| return 1; |
| ! return p_fic ? MB_TOUPPER(c1) - MB_TOUPPER(c2) |
| ! : c1 - c2; |
| } |
| } |
| if (s == NULL) |
| return 0; |
| |
| + c1 = PTR2CHAR((char_u *)s + i); |
| + c2 = PTR2CHAR((char_u *)s + i + MB_PTR2LEN((char_u *)s + i)); |
| |
| ! if (c2 == NUL |
| && i > 0 |
| && !after_pathsep((char_u *)s, (char_u *)s + i) |
| |
| ! && (c1 == '/' || c1 == '\\') |
| |
| ! && c1 == '/' |
| |
| ) |
| return 0; |
| *** ../vim-7.3.887/src/version.c 2013-04-12 13:44:49.000000000 +0200 |
| --- src/version.c 2013-04-12 14:10:41.000000000 +0200 |
| *************** |
| *** 730,731 **** |
| --- 730,733 ---- |
| { |
| + |
| + 888, |
| |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 155. You forget to eat because you're too busy surfing the net. |
| |
| /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ |
| /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ |
| \\\ an exciting new programming language -- http://www.Zimbu.org /// |
| \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |
| |