summaryrefslogtreecommitdiffstats
path: root/bin/sh/eval.c
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2010-11-20 14:14:52 +0000
committerjilles <jilles@FreeBSD.org>2010-11-20 14:14:52 +0000
commit6915411ab291af6eba93647d13c0aa6714621fa2 (patch)
treebb660239ff9ba03cd107817f9d8d00fabdba49a1 /bin/sh/eval.c
parent6a4a2e62a216ff7f70e10196bcdc7b3f4f76cad8 (diff)
downloadFreeBSD-src-6915411ab291af6eba93647d13c0aa6714621fa2.zip
FreeBSD-src-6915411ab291af6eba93647d13c0aa6714621fa2.tar.gz
sh: Code size optimizations to buffered output.
This is mainly less use of the outc macro. No functional change is intended, but code size is about 2K less on i386.
Diffstat (limited to 'bin/sh/eval.c')
-rw-r--r--bin/sh/eval.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c
index 415b9eb..c306e73 100644
--- a/bin/sh/eval.c
+++ b/bin/sh/eval.c
@@ -699,13 +699,13 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
for (sp = varlist.list ; sp ; sp = sp->next) {
if (sep != 0)
out2c(' ');
- p = sp->text;
- while (*p != '=' && *p != '\0')
- out2c(*p++);
- if (*p != '\0') {
- out2c(*p++);
+ p = strchr(sp->text, '=');
+ if (p != NULL) {
+ p++;
+ outbin(sp->text, p - sp->text, out2);
out2qstr(p);
- }
+ } else
+ out2qstr(sp->text);
sep = ' ';
}
for (sp = arglist.list ; sp ; sp = sp->next) {
OpenPOWER on IntegriCloud