[PATCH] completion_matches(): kill duplicate entries

Pavel Tsekov ptsekov at gmx.net
Wed Oct 27 07:25:26 UTC 2004


Hello,

A one liner that fixes duplicate completion matches if there are more
than two matches available. This is not a new bug - it was in 4.6.0 and
mayber earlier versions (haven't checked though).

To reproduce the bug put the same path in PATH three or more times. Try
to complete an executable that you know resides in that path.
-------------- next part --------------
Index: complete.c
===================================================================
RCS file: /cvsroot/mc/mc/src/complete.c,v
retrieving revision 1.52
diff -u -p -r1.52 complete.c
--- complete.c	23 Oct 2004 07:12:39 -0000	1.52
+++ complete.c	27 Oct 2004 08:53:38 -0000
@@ -575,6 +575,7 @@ completion_matches (char *text, Completi
 		    j++;
 		    if (j > matches)
 		        break;
+		    continue; /* Look for a run of equal strings */
 		} else
 	            if (low > si) low = si;
 		if (i + 1 != j) /* So there's some gap */


More information about the mc-devel mailing list