summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Lowe <richlowe@richlowe.net>2018-02-06 03:52:12 +0000
committerHans Rosenfeld <hans.rosenfeld@joyent.com>2018-04-23 18:15:40 +0200
commit6b8702c2d714a793b56a83a26988208caccea8d8 (patch)
tree42bf1a31783e72af91d651fadb03d01f01b16263
parent6c7cff64a7c0aafe97d354f169f3230bf9a353c0 (diff)
downloadillumos-joyent-6b8702c2d714a793b56a83a26988208caccea8d8.tar.gz
9419 testregex: condition otherwise unused variables
Reviewed by: Andy Stormont <astormont@racktopsystems.com> Reviewed by: Robert Mustacchi <rm@joyent.com> Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
-rw-r--r--usr/src/test/libc-tests/tests/regex/testregex.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr/src/test/libc-tests/tests/regex/testregex.c b/usr/src/test/libc-tests/tests/regex/testregex.c
index 0dd7b64680..8421e0f239 100644
--- a/usr/src/test/libc-tests/tests/regex/testregex.c
+++ b/usr/src/test/libc-tests/tests/regex/testregex.c
@@ -1220,7 +1220,9 @@ main(int argc, char** argv)
int cflags;
int eflags;
int nmatch;
+#if _REG_nexec
int nexec;
+#endif
int nstr;
int cret;
int eret;
@@ -1258,7 +1260,9 @@ main(int argc, char** argv)
static char strbuf[32 * 1024];
int nonosub = REG_NOSUB == 0;
+#if _REG_nexec
int nonexec = 0;
+#endif
unsigned long test = 0;
@@ -1291,7 +1295,9 @@ main(int argc, char** argv)
help(p[1] == 'h');
return 2;
case 'n':
+#if _REG_nexec
nonexec = 1;
+#endif
continue;
case 'o':
test |= TEST_IGNORE_OVER;
@@ -1921,10 +1927,8 @@ main(int argc, char** argv)
#if _REG_nexec
if (nstr >= 0 && nstr != strlen(s))
nexec = nstr;
-
- else
#endif
- nexec = -1;
+
if (state.extracted || (skip & level))
continue;
if (!(test & TEST_QUERY))
@@ -2117,7 +2121,7 @@ main(int argc, char** argv)
else
#endif
fun = "regexec";
-
+
for (i = 0; i < elementsof(match); i++)
match[i] = state.NOMATCH;