summaryrefslogtreecommitdiff
path: root/builtin-grep.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-grep.c')
-rw-r--r--builtin-grep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin-grep.c b/builtin-grep.c
index 2bfbdb7..cec2204 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -527,9 +527,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
opt.word_regexp = 1;
continue;
}
- if (!strncmp("-A", arg, 2) ||
- !strncmp("-B", arg, 2) ||
- !strncmp("-C", arg, 2) ||
+ if (!(-prefixcmp(arg, "-A")) ||
+ !(-prefixcmp(arg, "-B")) ||
+ !(-prefixcmp(arg, "-C")) ||
(arg[0] == '-' && '1' <= arg[1] && arg[1] <= '9')) {
unsigned num;
const char *scan;