Hi Bram,

2013/3/21(Thu) 5:24:00 UTC+9 Bram Moolenaar:
> h_east wrote:
> > 2013/3/20(Wed) 0:49:37 UTC+9 Bram Moolenaar:
> > > Patch 7.3.872
> > > 
> > > Problem:    On some systems case of file names is always ignored, on 
> > > others
> > > 
> > >       never.
> > > 
> > > Solution:   Add the 'fileignorecase' option to control this at runtime.
> > > 
> > >       Implies 'wildignorecase'.
> > > 
> > > Files:        src/buffer.c, src/edit.c, src/ex_cmds2.c, src/ex_getln.c,
> > > 
> > >       src/fileio.c, src/misc1.c, src/misc2.c, src/option.c,
> > > 
> > >       src/option.h, src/vim.h, runtime/doc/options.txt
> > 
> > When 'set fic' on linux, file name completion order is strange.
> > It's different for both case-sensitive and case-insensitive.
> > 
> > How to reproduce (on fedora17)
> > $ mkdir test_fic
> > $ cd !$
> > $ touch I1.txt  I2.txt  J3.txt  J4.txt  i1.txt  j3.txt
> > (Necessary: same file name (without case-sensitive) exist.)
Sorry, It's doubt.
This condition was not necessary.

I report again below.

How to reproduce (on linux)
$ mkdir test_fic
$ cd !$
$ touch i1.txt I2.txt J3.txt j4.txt

$ vim -N -u NONE -i NONE --noplugin -c "set fic"
input i<C-X><C-F>

Actual result
(popup menu list items)
I2.txt
J3.txt
i1.txt
j4.txt

Expect result
i1.txt
I2.txt
J3.txt
j4.txt

I update a patch. (against multi-byte).
Please check.

Best Regards,
Hirohito Higashi

-- 
-- 
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/groups/opt_out.


diff -r acf7368a2acc src/misc2.c
--- a/src/misc2.c	Thu Mar 21 22:53:50 2013 +0100
+++ b/src/misc2.c	Mon Mar 25 04:11:54 2013 +0900
@@ -6099,52 +6099,59 @@
     int maxlen;
 {
     int		i;
+    int		c1, c2;
     const char	*s = NULL;
 
-    for (i = 0; maxlen < 0 || i < maxlen; ++i)
+    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);
+
 	/* End of "p": check if "q" also ends or just has a slash. */
-	if (p[i] == NUL)
+	if (c1 == NUL)
 	{
-	    if (q[i] == NUL)  /* full match */
+	    if (c2 == NUL)  /* full match */
 		return 0;
 	    s = q;
 	    break;
 	}
 
 	/* End of "q": check if "p" just has a slash. */
-	if (q[i] == NUL)
+	if (c2 == NUL)
 	{
 	    s = p;
 	    break;
 	}
 
-	if ((p_fic ? TOUPPER_LOC(p[i]) != TOUPPER_LOC(q[i]) : p[i] != q[i])
+	if ((p_fic ? MB_TOUPPER(c1) != MB_TOUPPER(c2) : c1 != c2)
 #ifdef BACKSLASH_IN_FILENAME
 		/* consider '/' and '\\' to be equal */
-		&& !((p[i] == '/' && q[i] == '\\')
-		    || (p[i] == '\\' && q[i] == '/'))
+		&& !((c1 == '/' && c2 == '\\')
+		    || (c1 == '\\' && c2 == '/'))
 #endif
 		)
 	{
-	    if (vim_ispathsep(p[i]))
+	    if (vim_ispathsep(c1))
 		return -1;
-	    if (vim_ispathsep(q[i]))
+	    if (vim_ispathsep(c2))
 		return 1;
-	    return ((char_u *)p)[i] - ((char_u *)q)[i];	    /* no match */
+	    return p_fic ? MB_TOUPPER(c1) - MB_TOUPPER(c2)
+		    : c1 - c2;  /* no match */
 	}
     }
     if (s == NULL)	/* "i" ran into "maxlen" */
 	return 0;
 
+    c1 = PTR2CHAR((char_u *)s + i);
+    c2 = PTR2CHAR((char_u *)s + i + MB_PTR2LEN((char_u *)s + i));
     /* ignore a trailing slash, but not "//" or ":/" */
-    if (s[i + 1] == NUL
+    if (c2 == NUL
 	    && i > 0
 	    && !after_pathsep((char_u *)s, (char_u *)s + i)
 #ifdef BACKSLASH_IN_FILENAME
-	    && (s[i] == '/' || s[i] == '\\')
+	    && (c1 == '/' || c1 == '\\')
 #else
-	    && s[i] == '/'
+	    && c1 == '/'
 #endif
        )
 	return 0;   /* match with trailing slash */

Raspunde prin e-mail lui