about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-12 12:44:07 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-12 12:44:07 +0000
commit13c09ff02f14f54dd9246ee93fa335b82f076079 (patch)
tree631e75cf2d60e36c7c62ed5feb620bec9cd4e02d
parentbfd6782b5a7a75568be3554bbdc7d7eee53e6538 (diff)
downloadzsh-13c09ff02f14f54dd9246ee93fa335b82f076079.tar.gz
zsh-13c09ff02f14f54dd9246ee93fa335b82f076079.tar.xz
zsh-13c09ff02f14f54dd9246ee93fa335b82f076079.zip
zsh-workers/9296
-rw-r--r--Src/Zle/compmatch.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index b5ea5affe..8dc6527c8 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -436,7 +436,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
 	  int sfx, int test, int part)
 {
     int ll = strlen(l), lw = strlen(w), oll = ll, olw = lw;
-    int il = 0, iw = 0, t, ind, add, he = 0, bpc, obc = bc;
+    int il = 0, iw = 0, t, ind, add, he = 0, bpc, obc = bc, bslash;
     VARARR(unsigned char, ea, ll + 1);
     char *ow;
     Cmlist ms;
@@ -736,12 +736,15 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
 	if (mp)
 	    continue;
 
-	if (l[ind] == w[ind]) {
+	bslash = 0;
+	if (l[ind] == w[ind] ||
+	    (bslash = (lw > 1 && w[ind] == '\\' &&
+		       (ind ? (w[0] == l[0]) : (w[1] == l[0]))))) {
 	    /* No matcher could be used, but the strings have the same
 	     * character here, skip over it. */
-	    l += add; w += add;
-	    il++; iw++;
-	    ll--; lw--;
+	    l += add; w += (bslash ? (add + add ) : add);
+	    il++; iw += 1 + bslash;
+	    ll--; lw -= 1 + bslash;
 	    bc++;
 	    if (!test)
 		while (bp && bc >= (useqbr ? bp->qpos : bp->pos)) {