summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--Src/Zle/compcore.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9af243c48..10b7ac945 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2022-04-11  Mikael Magnusson  <mikachu@gmail.com>
+
+	* 50042: Src/Zle/compcore.c: Another fix for 49915
+
 2022-04-10  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* unposted: NEWS: Improve flow between the paragraph and
diff --git a/Src/Zle/compcore.c b/Src/Zle/compcore.c
index fe3ea10fc..4ac5d089f 100644
--- a/Src/Zle/compcore.c
+++ b/Src/Zle/compcore.c
@@ -3314,7 +3314,7 @@ makearray(LinkList l, int type, int flags, int *np, int *nlp, int *llp)
 		if (del) {
 		    int n_orig = n;
 		    for (bp = rp, ap = rp; bp < rp + n_orig; ap++, bp++) {
-			while (bp[0]->flags & CMF_DELETE) {
+			while (bp < rp + n_orig && (bp[0]->flags & CMF_DELETE)) {
 			    bp++;
 			    n--;
 			}