summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorPaul Fox2005-07-21 12:03:05 +0000
committerPaul Fox2005-07-21 12:03:05 +0000
commit8de331def08568678fa09536b5589ea473bee6e6 (patch)
treeb5f1accbe77c45fe27b54d48d5cf255a7bfc8cbd /shell
parent0840b76602900f8236f444b68da16d5c8d57ac3d (diff)
downloadbusybox-8de331def08568678fa09536b5589ea473bee6e6.zip
busybox-8de331def08568678fa09536b5589ea473bee6e6.tar.gz
revert 10881, and refix by changing "if (vallen)" to "if (val)". this
is per the upstream fix for dash, in dash_0.5.2-6.diff. thanks vodz, for catching this.
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 8656c02..7832049 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -12001,8 +12001,9 @@ setvar(const char *name, const char *val, int flags)
}
INTOFF;
p = mempcpy(nameeq = ckmalloc(namelen + vallen + 2), name, namelen);
- *p++ = '=';
- if (vallen) {
+ *p++ = '\0';
+ if (val) {
+ p[-1] = '=';
p = mempcpy(p, val, vallen);
}
*p = '\0';