diff options
author | jilles <jilles@FreeBSD.org> | 2015-02-15 21:41:29 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2015-02-15 21:41:29 +0000 |
commit | 48c4b8825b60b1848f9978a949ecd154ac9330c3 (patch) | |
tree | c36f84630b24693d8cf17b0d6a9606dcbe8ce91a /bin/sh/expand.c | |
parent | e751f888a0a8701c0797b39e00ebe4beca4b8192 (diff) | |
download | FreeBSD-src-48c4b8825b60b1848f9978a949ecd154ac9330c3.zip FreeBSD-src-48c4b8825b60b1848f9978a949ecd154ac9330c3.tar.gz |
sh: Add stsavestr(), like savestr() but allocates using stalloc().
Diffstat (limited to 'bin/sh/expand.c')
-rw-r--r-- | bin/sh/expand.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/bin/sh/expand.c b/bin/sh/expand.c index b542303..53b2c9b 100644 --- a/bin/sh/expand.c +++ b/bin/sh/expand.c @@ -1284,11 +1284,8 @@ addfname(char *name) { char *p; struct strlist *sp; - size_t len; - len = strlen(name); - p = stalloc(len + 1); - memcpy(p, name, len + 1); + p = stsavestr(name); sp = (struct strlist *)stalloc(sizeof *sp); sp->text = p; *exparg.lastp = sp; |