about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2001-12-18 09:16:17 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2001-12-18 09:16:17 +0000
commit68d739c67a10db0b97b0efaaa730f71bf47f4ab5 (patch)
tree985975786e5a239bd926873fa665253df5ff8523
parent0db3827ce271b3d334d1c040636e144ca5cf9fa1 (diff)
downloadzsh-68d739c67a10db0b97b0efaaa730f71bf47f4ab5.tar.gz
zsh-68d739c67a10db0b97b0efaaa730f71bf47f4ab5.tar.xz
zsh-68d739c67a10db0b97b0efaaa730f71bf47f4ab5.zip
small fix to += code from 16353
-rw-r--r--ChangeLog4
-rw-r--r--Src/params.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 5b810847a..d1a0a34f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-12-18  Oliver Kiddle  <opk@zsh.org>
+
+	* unposted: Src/params.c: small fix to += code from 16353
+
 2001-12-18  Clint Adams  <clint@zsh.org>
 
 	* 16361: zshconfig.ac, Src/input.c:
diff --git a/Src/params.c b/Src/params.c
index 6fb5da57f..35f699033 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1879,7 +1879,7 @@ assignsparam(char *s, char *val, int augment)
     Value v;
     char *t = s;
     char *ss, *copy, *var;
-    size_t lv;
+    size_t lvar;
     mnumber lhs, rhs;
     int sstart;
 
@@ -1975,10 +1975,10 @@ assignsparam(char *s, char *val, int augment)
 		var = getstrvalue(v);
 		v->start = sstart;
 		copy = val;
-		lv = strlen(var);
-		val = (char *)zalloc(lv + strlen(var));
+		lvar = strlen(var);
+		val = (char *)zalloc(lvar + strlen(val) + 1);
 		strcpy(val, var);
-		strcpy(val + lv, copy);
+		strcpy(val + lvar, copy);
 		zsfree(copy);
 		break;
 	    }