aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/strings.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/strings.c
parent141a075c0e192dc9910e777270114b1864270bfd (diff)
downloadtoybox-747e296ff656813340c9355d98b0a13cba8473bc.tar.gz
Add FLAG(x) macro, expanding to (toys.optflags & FLAG_##x)
Diffstat (limited to 'toys/posix/strings.c')
-rw-r--r--toys/posix/strings.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/toys/posix/strings.c b/toys/posix/strings.c
index e33ae960..816280b0 100644
--- a/toys/posix/strings.c
+++ b/toys/posix/strings.c
@@ -66,9 +66,8 @@ static void do_strings(int fd, char *filename)
else {
string[count++] = toybuf[i];
if (count == wlen) {
- if (toys.optflags & FLAG_f) printf("%s: ", filename);
- if (toys.optflags & (FLAG_o|FLAG_t))
- printf(pattern, (long long)(offset - wlen));
+ if (FLAG(f)) printf("%s: ", filename);
+ if (FLAG(o) || FLAG(t)) printf(pattern, (long long)(offset - wlen));
printf("%s", string);
}
}