# HG changeset patch # User Rob Landley # Date 1334457679 18000 # Node ID b24c4fe9f4fd01ceaf964ae02f8a91b6051fe3d3 # Parent 4d802d43898345f8c996862844394a4f3b5d3049 Use FLAG_ macros for echo optflags. diff -r 4d802d438983 -r b24c4fe9f4fd toys/echo.c --- a/toys/echo.c Sat Apr 14 21:27:00 2012 -0500 +++ b/toys/echo.c Sat Apr 14 21:41:19 2012 -0500 @@ -32,8 +32,12 @@ \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 @@ // Should we output arg verbatim? - if (!(toys.optflags&2)) { + if (!(toys.optflags&FLAG_e)) { xprintf("%s", arg); continue; } @@ -87,7 +91,7 @@ } // Output "\n" if no -n - if (!(toys.optflags&1)) xputc('\n'); + if (!(toys.optflags&FLAG_n)) xputc('\n'); done: xflush(); }