From 452ff9e58b585bf0de9c8211e0d8889cba5f435d Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 20 Jan 2007 22:41:29 -0500 Subject: Comment and whitespace cleanups --- toys/echo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'toys') 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: -- cgit v1.2.3