aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/wc.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2018-12-04 21:29:51 -0600
committerRob Landley <rob@landley.net>2018-12-04 21:29:51 -0600
commit747e296ff656813340c9355d98b0a13cba8473bc (patch)
treee7ef2b20be56e2e5a2062168aa822fd6c6139b7d /toys/posix/wc.c
parent141a075c0e192dc9910e777270114b1864270bfd (diff)
downloadtoybox-747e296ff656813340c9355d98b0a13cba8473bc.tar.gz
Add FLAG(x) macro, expanding to (toys.optflags & FLAG_##x)
Diffstat (limited to 'toys/posix/wc.c')
-rw-r--r--toys/posix/wc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/wc.c b/toys/posix/wc.c
index 5d362e7d..910e4690 100644
--- a/toys/posix/wc.c
+++ b/toys/posix/wc.c
@@ -42,7 +42,7 @@ static void show_lengths(unsigned long *lengths, char *name)
// And, yes, folks have test scripts that rely on all this nonsense :-(
// Note: sufficiently modern versions of coreutils wc will use the smallest
// column width necessary to have all columns be equal width rather than 0.
- if (!(toys.optc==0 && (toys.optflags & (toys.optflags-1))==0) && toys.optc!=1)
+ if (!(!toys.optc && !(toys.optflags & (toys.optflags-1))) && toys.optc!=1)
space = 7;
for (i = 0; i<4; i++) {
@@ -82,7 +82,7 @@ static void do_wc(int fd, char *name)
for (pos = 0; pos<len; pos++) {
if (toybuf[pos]=='\n') lengths[0]++;
lengths[2]++;
- if (toys.optflags&FLAG_m) {
+ if (FLAG(m)) {
// If we've consumed next wide char
if (--clen<1) {
wchar_t wchar;