From 747e296ff656813340c9355d98b0a13cba8473bc Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 4 Dec 2018 21:29:51 -0600 Subject: Add FLAG(x) macro, expanding to (toys.optflags & FLAG_##x) --- toys/posix/strings.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'toys/posix/strings.c') 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); } } -- cgit v1.2.3