revert 10881, and refix by changing "if (vallen)" to "if (val)". this
authorpgf <pgf@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Thu, 21 Jul 2005 12:03:05 +0000 (12:03 +0000)
committerpgf <pgf@69ca8d6d-28ef-0310-b511-8ec308f3f277>
Thu, 21 Jul 2005 12:03:05 +0000 (12:03 +0000)
is per the upstream fix for dash, in dash_0.5.2-6.diff.  thanks vodz, for
catching this.

git-svn-id: svn://busybox.net/trunk/busybox@10888 69ca8d6d-28ef-0310-b511-8ec308f3f277

shell/ash.c

index 8656c02..7832049 100644 (file)
@@ -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';