From ea5c68a5b09e1b3c58f1a874acf52848834d8014 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 14 Apr 2012 21:41:19 -0500 Subject: Use FLAG_ macros for echo optflags. --- toys/echo.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/toys/echo.c b/toys/echo.c index de4be54b..6fb9e43d 100644 --- a/toys/echo.c +++ b/toys/echo.c @@ -32,8 +32,12 @@ config ECHO \xHH hexadecimal values (1 to 2 digits) */ +#define THIS echo #include "toys.h" +#define FLAG_e (1<<1) +#define FLAG_n (1<<0) + void echo_main(void) { int i = 0, out; @@ -46,7 +50,7 @@ void echo_main(void) // Should we output arg verbatim? - if (!(toys.optflags&2)) { + if (!(toys.optflags&FLAG_e)) { xprintf("%s", arg); continue; } @@ -87,7 +91,7 @@ void echo_main(void) } // Output "\n" if no -n - if (!(toys.optflags&1)) xputc('\n'); + if (!(toys.optflags&FLAG_n)) xputc('\n'); done: xflush(); } -- cgit v1.2.3