about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2014-08-01 14:24:41 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2014-08-01 14:24:41 +0530
commit78dd658a025fb16d004677284b4db0d0c0191845 (patch)
tree57604f11d042cd75b46f22d08ed852ecd44eddc1
parent3f3dd810e03661535980e334723666205c693313 (diff)
downloadglibc-78dd658a025fb16d004677284b4db0d0c0191845.tar.gz
glibc-78dd658a025fb16d004677284b4db0d0c0191845.tar.xz
glibc-78dd658a025fb16d004677284b4db0d0c0191845.zip
Check if DEBUG is defined in regex_internal.c
The DEBUG macro is checked for its value in one place and if it is
defined in another.  Make this consistent across the two cases and use
the same style that we did in mktime.c, which is to check if the macro
is defined and it is set.
-rw-r--r--ChangeLog3
-rw-r--r--posix/regex_internal.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c5d2107f2..e69f433669 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-08-01  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
+	* posix/regex_internal.c: Check if DEBUG is defined and is
+	set.
+
 	* include/libc-symbols.h (HAVE_MBSTATE_T): Define macro.
 	(HAVE_MBSRTOWCS): Likewise.
 	* posix/fnmatch.c: Include string.h unconditionally.
diff --git a/posix/regex_internal.c b/posix/regex_internal.c
index 7eebf46924..86c04a807c 100644
--- a/posix/regex_internal.c
+++ b/posix/regex_internal.c
@@ -679,7 +679,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
 			 pstr->valid_len - offset);
 	      pstr->valid_len -= offset;
 	      pstr->valid_raw_len -= offset;
-#if DEBUG
+#if defined DEBUG && DEBUG
 	      assert (pstr->valid_len > 0);
 #endif
 	    }
@@ -936,7 +936,7 @@ re_string_context_at (const re_string_t *input, int idx, int eflags)
       int wc_idx = idx;
       while(input->wcs[wc_idx] == WEOF)
 	{
-#ifdef DEBUG
+#if defined DEBUG && DEBUG
 	  /* It must not happen.  */
 	  assert (wc_idx >= 0);
 #endif