diff options
Diffstat (limited to 'builtin/grep.c')
-rw-r--r-- | builtin/grep.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/grep.c b/builtin/grep.c index 6831975104..8f2602653e 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -925,9 +925,11 @@ int cmd_grep(int argc, const char **argv, const char *prefix) if (!opt.pattern_list) die(_("no pattern given.")); + if (opt.regflags != REG_NEWLINE && opt.pcre) + die(_("cannot mix --extended-regexp and --perl-regexp")); if (!opt.fixed && opt.ignore_case) opt.regflags |= REG_ICASE; - if ((opt.regflags != REG_NEWLINE) && opt.fixed) + if ((opt.regflags != REG_NEWLINE || opt.pcre) && opt.fixed) die(_("cannot mix --fixed-strings and regexp")); #ifndef NO_PTHREADS |