summaryrefslogtreecommitdiff
path: root/pcregrep.c
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-01-15 15:50:06 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2012-01-15 15:50:06 +0000
commit8eecdf202d334c6547a937193f830ad579d8e8dc (patch)
tree635a38e1e99f353bb225214cdf539a9889fe09e5 /pcregrep.c
parentfa0d15f15c45a08d2896941e29b8e7b6ca2b6230 (diff)
downloadpcre-8eecdf202d334c6547a937193f830ad579d8e8dc.tar.gz
Avoid compiler warning when neither SUPPORT_LIBZ nor SUPPORT_LIBZ2 is set.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@879 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcregrep.c')
-rw-r--r--pcregrep.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pcregrep.c b/pcregrep.c
index b56554e..10504be 100644
--- a/pcregrep.c
+++ b/pcregrep.c
@@ -1573,7 +1573,6 @@ grep_or_recurse(char *pathname, BOOL dir_recurse, BOOL only_one_at_top)
int rc = 1;
int sep;
int frtype;
-int pathlen;
void *handle;
FILE *in = NULL; /* Ensure initialized */
@@ -1585,6 +1584,10 @@ gzFile ingz = NULL;
BZFILE *inbz2 = NULL;
#endif
+#if defined SUPPORT_LIBZ || defined SUPPORT_LIBZ2
+int pathlen;
+#endif
+
/* If the file name is "-" we scan stdin */
if (strcmp(pathname, "-") == 0)
@@ -1664,7 +1667,9 @@ skipping was not requested. The scan proceeds. If this is the first and only
argument at top level, we don't show the file name, unless we are only showing
the file name, or the filename was forced (-H). */
+#if defined SUPPORT_LIBZ || defined SUPPORT_LIBZ2
pathlen = (int)(strlen(pathname));
+#endif
/* Open using zlib if it is supported and the file name ends with .gz. */