Fix violation of <stdbool.h> replacement in regex.
authorEric Blake <ebb9@byu.net>
Thu, 15 May 2008 20:51:43 +0000 (14:51 -0600)
committerEric Blake <ebb9@byu.net>
Thu, 15 May 2008 20:51:43 +0000 (14:51 -0600)
* lib/regexec.c (re_search_internal): Avoid implicit cast to bool.
Reported by Heinrich Mislik <Heinrich.Mislik@univie.ac.at>.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/regexec.c

index 04ee46e..fdb4b98 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        Fix violation of <stdbool.h> replacement in regex.
        * lib/regcomp.c (re_compile_internal): Avoid implicit cast to bool.
+       * lib/regexec.c (re_search_internal): Likewise.
        Reported by Heinrich Mislik <Heinrich.Mislik@univie.ac.at>.
 
 2008-05-15  Jim Meyering  <meyering@redhat.com>
index b136570..3e51b49 100644 (file)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation,
+   Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation,
    Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
@@ -701,7 +701,8 @@ re_search_internal (const regex_t *preg,
   fl_longest_match = (nmatch != 0 || dfa->nbackref);
 
   err = re_string_allocate (&mctx.input, string, length, dfa->nodes_len + 1,
-                           preg->translate, preg->syntax & RE_ICASE, dfa);
+                           preg->translate, (preg->syntax & RE_ICASE) != 0,
+                           dfa);
   if (BE (err != REG_NOERROR, 0))
     goto free_return;
   mctx.input.stop = stop;
@@ -3467,7 +3468,7 @@ out_free:
                                                        CONTEXT_NEWLINE);
          if (BE (dest_states_nl[i] == NULL && err != REG_NOERROR, 0))
            goto out_free;
-       }
+       }
       else
        {
          dest_states_word[i] = dest_states[i];