diff options
author | herbert <herbert@gondor.apana.org.au> | 2005-03-25 20:23:55 +1100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2005-09-26 18:33:05 +1000 |
commit | 6d8a11f801b41b629d0ad3c71fc5298354ae99ef (patch) | |
tree | 753ae678750fe77c2a9aad9609291a361f38806b /src | |
parent | Add trailing equal sign in setvar for variables set to null. (diff) | |
download | dash-6d8a11f801b41b629d0ad3c71fc5298354ae99ef.tar.gz dash-6d8a11f801b41b629d0ad3c71fc5298354ae99ef.zip |
Eliminate first null termination in setvar.
Diffstat (limited to 'src')
-rw-r--r-- | src/var.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/var.c b/src/var.c index a7791eb..ea62327 100644 --- a/src/var.c +++ b/src/var.c @@ -231,9 +231,8 @@ setvar(const char *name, const char *val, int flags) } INTOFF; p = mempcpy(nameeq = ckmalloc(namelen + vallen + 2), name, namelen); - *p++ = '\0'; if (val) { - p[-1] = '='; + *p++ = '='; p = mempcpy(p, val, vallen); } *p = '\0'; |