[Pcre-svn] [879] code/trunk/pcregrep.c: Avoid compiler warni…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [879] code/trunk/pcregrep.c: Avoid compiler warning when neither SUPPORT_LIBZ nor SUPPORT_LIBZ2 is set.
Revision: 879
          http://vcs.pcre.org/viewvc?view=rev&revision=879
Author:   ph10
Date:     2012-01-15 15:50:06 +0000 (Sun, 15 Jan 2012)


Log Message:
-----------
Avoid compiler warning when neither SUPPORT_LIBZ nor SUPPORT_LIBZ2 is set.

Modified Paths:
--------------
    code/trunk/pcregrep.c


Modified: code/trunk/pcregrep.c
===================================================================
--- code/trunk/pcregrep.c    2012-01-15 15:44:47 UTC (rev 878)
+++ code/trunk/pcregrep.c    2012-01-15 15:50:06 UTC (rev 879)
@@ -1573,7 +1573,6 @@
 int rc = 1;
 int sep;
 int frtype;
-int pathlen;
 void *handle;
 FILE *in = NULL;           /* Ensure initialized */


@@ -1585,6 +1584,10 @@
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 @@
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. */