]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Check if DEBUG is defined in regex_internal.c
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Fri, 1 Aug 2014 08:54:41 +0000 (14:24 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Fri, 1 Aug 2014 08:54:41 +0000 (14:24 +0530)
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.

ChangeLog
posix/regex_internal.c

index 2c5d2107f2ae13dd21d4db393ef0b0654e285340..e69f433669067606f87f999b3cb6c9fb299a8fa6 100644 (file)
--- 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.
index 7eebf469242dc56ae6e7f2ee0d35def552c50aab..86c04a807caf2120eee13ff6e190bc371e650d87 100644 (file)
@@ -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