From: Paul Fox Date: Thu, 21 Jul 2005 12:03:05 +0000 (-0000) Subject: revert 10881, and refix by changing "if (vallen)" to "if (val)". this X-Git-Tag: 1_1_0~883 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8de331def08568678fa09536b5589ea473bee6e6;p=oweals%2Fbusybox.git 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. --- 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';