diff options
-rw-r--r-- | shell/ash.c | 5 |
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'; |