summaryrefslogtreecommitdiff
path: root/pcre/pcregrep.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-12-13 10:14:29 +0100
committerSergei Golubchik <serg@mariadb.org>2015-12-13 10:14:29 +0100
commite7591a1ba94f404a87e65554298574bfa97020f2 (patch)
tree67e7e8327703110ea82989f302fd87dfedbdde1c /pcre/pcregrep.c
parentc4cc91cdc9a236c22749c9c9decd7d190d0eb7fa (diff)
downloadmariadb-git-e7591a1ba94f404a87e65554298574bfa97020f2.tar.gz
8.38
Diffstat (limited to 'pcre/pcregrep.c')
-rw-r--r--pcre/pcregrep.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pcre/pcregrep.c b/pcre/pcregrep.c
index c49a74ffb78..64986b016e6 100644
--- a/pcre/pcregrep.c
+++ b/pcre/pcregrep.c
@@ -1692,9 +1692,13 @@ while (ptr < endptr)
if (filenames == FN_NOMATCH_ONLY) return 1;
+ /* If all we want is a yes/no answer, stop now. */
+
+ if (quiet) return 0;
+
/* Just count if just counting is wanted. */
- if (count_only) count++;
+ else if (count_only) count++;
/* When handling a binary file and binary-files==binary, the "binary"
variable will be set true (it's false in all other cases). In this
@@ -1715,10 +1719,6 @@ while (ptr < endptr)
return 0;
}
- /* Likewise, if all we want is a yes/no answer. */
-
- else if (quiet) return 0;
-
/* The --only-matching option prints just the substring that matched,
and/or one or more captured portions of it, as long as these strings are
not empty. The --file-offsets and --line-offsets options output offsets for
@@ -2089,7 +2089,7 @@ if (filenames == FN_NOMATCH_ONLY)
/* Print the match count if wanted */
-if (count_only)
+if (count_only && !quiet)
{
if (count > 0 || !omit_zero_count)
{