aboutsummaryrefslogtreecommitdiff
path: root/toys/echo.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2007-01-20 22:41:29 -0500
committerRob Landley <rob@landley.net>2007-01-20 22:41:29 -0500
commit452ff9e58b585bf0de9c8211e0d8889cba5f435d (patch)
tree10cee2088d625ebd0d2ed31fa912201629697af7 /toys/echo.c
parent3ec53ce1d4bde7c41db6a9007b15b99e43cd006a (diff)
downloadtoybox-452ff9e58b585bf0de9c8211e0d8889cba5f435d.tar.gz
Comment and whitespace cleanups
Diffstat (limited to 'toys/echo.c')
-rw-r--r--toys/echo.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/toys/echo.c b/toys/echo.c
index 93a3dbc0..397c21a7 100644
--- a/toys/echo.c
+++ b/toys/echo.c
@@ -14,7 +14,9 @@ int echo_main(void)
arg = toys.optargs[i];
if (!arg) break;
if (i++) xputc(' ');
-
+
+ // Handle -e
+
if (toys.optflags&2) {
int c, j = 0;
for (;;) {
@@ -24,6 +26,7 @@ int echo_main(void)
char *found;
int d = arg[j++];
+ // handle \escapes
if (d) {
found = strchr(from, d);
@@ -34,14 +37,13 @@ int echo_main(void)
while (arg[j]>='0' && arg[j]<='7')
c = (c*8)+arg[j++]-'0';
}
- // \0123
}
}
xputc(c);
}
- // \\ thingy
} else xprintf("%s", arg);
}
+
// Output "\n" if no -n
if (!(toys.optflags&1)) xputc('\n');
done: