summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenis Vlasenko2007-09-27 10:20:47 +0000
committerDenis Vlasenko2007-09-27 10:20:47 +0000
commit4daad9004d8f07991516970a1cbd77756fae7041 (patch)
treef1a17e4b168ef8fdf8af92ac5ce8deba89d38db2 /shell
parent1acdc89e992eb3f0548ff48ba586b31c9a0ae232 (diff)
downloadbusybox-4daad9004d8f07991516970a1cbd77756fae7041.zip
busybox-4daad9004d8f07991516970a1cbd77756fae7041.tar.gz
introduce bb_putchar(). saves ~1800 on uclibc (less on glibc).
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c2
-rw-r--r--shell/lash.c4
-rw-r--r--shell/msh.c10
3 files changed, 8 insertions, 8 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 5796f11..5f9f2c5 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -2004,7 +2004,7 @@ static int run_list_real(struct pipe *pi)
insert_bg_job(pi);
} else {
/* ctrl-C. We just stop doing whatever we were doing */
- putchar('\n');
+ bb_putchar('\n');
}
rcode = 0;
goto ret;
diff --git a/shell/lash.c b/shell/lash.c
index 889fe49..4ce6d42 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -319,7 +319,7 @@ static int builtin_help(struct child_prog ATTRIBUTE_UNUSED *dummy)
continue;
printf("%s\t%s\n", x->cmd, x->descr);
}
- putchar('\n');
+ bb_putchar('\n');
return EXIT_SUCCESS;
}
@@ -677,7 +677,7 @@ static int get_command_bufsiz(FILE * source, char *command)
if (!fgets(command, BUFSIZ - 2, source)) {
if (source == stdin)
- puts("");
+ bb_putchar('\n');
return 1;
}
diff --git a/shell/msh.c b/shell/msh.c
index f1b3f05..41fe1b6 100644
--- a/shell/msh.c
+++ b/shell/msh.c
@@ -1137,7 +1137,7 @@ static void nameval(struct var *vp, const char *val, const char *name)
if (vp->status & RONLY) {
xp = vp->name;
while (*xp && *xp != '=')
- putc(*xp++, stderr);
+ fputc(*xp++, stderr);
err(" is read-only");
return;
}
@@ -3181,7 +3181,7 @@ static int dohelp(struct op *t)
while (x->name) {
col += printf("%c%s", ((col == 0) ? '\t' : ' '), x->name);
if (col > 60) {
- puts("");
+ bb_putchar('\n');
col = 0;
}
x++;
@@ -3193,7 +3193,7 @@ static int dohelp(struct op *t)
while (applet->name) {
col += printf("%c%s", ((col == 0) ? '\t' : ' '), applet->name);
if (col > 60) {
- puts("");
+ bb_putchar('\n');
col = 0;
}
applet++;
@@ -3274,8 +3274,8 @@ static int doumask(struct op *t)
i = umask(0);
umask(i);
for (n = 3 * 4; (n -= 3) >= 0;)
- putc('0' + ((i >> n) & 07), stderr);
- putc('\n', stderr);
+ fputc('0' + ((i >> n) & 07), stderr);
+ fputc('\n', stderr);
} else {
/* huh??? '8','9' are not allowed! */
for (n = 0; *cp >= '0' && *cp <= '9'; cp++)