summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Zle/compctl.c8
2 files changed, 8 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index bc6f1dd03..8cc48aae5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-04-10 Peter Stephenson <p.stephenson@samsung.com>
+
+ * 44202: Src/Zle/compctl.c: Rewrite to use memmove()
+ for possibly overlapping copy.
+
2019-04-10 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
* 44210: Completion/Linux/Command/_findmnt,
diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index fe87409cb..f963d5712 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -3331,13 +3331,11 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
zlemetaline[end] = save;
if (brend) {
Brinfo bp;
- char *p;
- int bl;
for (bp = brend; bp; bp = bp->next) {
- p = lpsuf + (we - zlemetacs) - bp->qpos -
- (bl = strlen(bp->str));
- strcpy(p, p + bl);
+ char *p2 = lpsuf + (we - zlemetacs) - bp->qpos;
+ char *p1 = p2 - strlen(bp->str);
+ memmove(p1, p2, strlen(p2) + 1);
}
}
if (!(lpsuf = strchr(lpsuf, '/')) && sf2)