introduce bb_putchar(). saves ~1800 on uclibc (less on glibc).
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 @@
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 @@
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 @@
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 @@
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++)