aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorGravatar Paul Fox <pgf@brightstareng.com>2005-07-21 12:03:05 +0000
committerGravatar Paul Fox <pgf@brightstareng.com>2005-07-21 12:03:05 +0000
commit8de331def08568678fa09536b5589ea473bee6e6 (patch)
treeb5f1accbe77c45fe27b54d48d5cf255a7bfc8cbd /shell
parent0840b76602900f8236f444b68da16d5c8d57ac3d (diff)
downloadbusybox-8de331def08568678fa09536b5589ea473bee6e6.tar.gz
busybox-8de331def08568678fa09536b5589ea473bee6e6.tar.bz2
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 8656c0219..783204933 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';