about summary refs log tree commit diff
path: root/Src/Zle/compresult.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle/compresult.c')
-rw-r--r--Src/Zle/compresult.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/Zle/compresult.c b/Src/Zle/compresult.c
index 531017afb..c55b65b0a 100644
--- a/Src/Zle/compresult.c
+++ b/Src/Zle/compresult.c
@@ -656,7 +656,8 @@ do_ambiguous(void)
 	/* Sometimes the different match specs used may result in a cline
 	 * that gives an empty string. If that happened, we re-insert the
          * old string. Unless there were matches added with -U, that is. */
-	if (!(lastend - wb) && !hasunmatched) {
+
+	if (lastend < we && !lenchanged && !hasunmatched) {
 	    cs = wb;
 	    foredel(lastend - wb);
 	    inststrlen(old, 0, we - wb);