aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-04-14 21:41:19 -0500
committerRob Landley <rob@landley.net>2012-04-14 21:41:19 -0500
commitea5c68a5b09e1b3c58f1a874acf52848834d8014 (patch)
treea3380b7c5ff2d10d8c6d6d0d297c9ba1fce8d51e
parent2a9dde00db289995b0dec48928c5e1656f7b9323 (diff)
downloadtoybox-ea5c68a5b09e1b3c58f1a874acf52848834d8014.tar.gz
Use FLAG_ macros for echo optflags.
-rw-r--r--toys/echo.c8
1 files 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();
}