summary refs log tree commit diff
path: root/Src/Zle/compmatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/compmatch.c')
-rw-r--r--Src/Zle/compmatch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c
index 8cdfddede..180dce5df 100644
--- a/Src/Zle/compmatch.c
+++ b/Src/Zle/compmatch.c
@@ -488,7 +488,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
 	 */
 
 	bslash = 0;
-	if (test && !sfx &&
+	if (test && !sfx && lw &&
 	    (l[ind] == w[ind] ||
 	     (bslash = (lw > 1 && w[ind] == '\\' &&
 			(ind ? (w[0] == l[0]) : (w[1] == l[0])))))) {
@@ -803,7 +803,7 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp,
 	/* Same code as at the beginning, used in top-level calls. */
 
 	bslash = 0;
-	if ((!test || sfx) &&
+	if ((!test || sfx) && lw &&
 	    (l[ind] == w[ind] ||
 	     (bslash = (lw > 1 && w[ind] == '\\' &&
 			(ind ? (w[0] == l[0]) : (w[1] == l[0])))))) {