regex: simplify based on Gawk version
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 30 Dec 2012 22:28:55 +0000 (14:28 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 31 Dec 2012 03:26:28 +0000 (19:26 -0800)
* lib/regex_internal.c (re_dfa_add_node): Simplify.
Reported by Aharon Robbins in
<http://sourceware.org/ml/libc-alpha/2012-12/msg00456.html>.

ChangeLog
lib/regex_internal.c

index 0c3c7f1..2363f6e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-12-30  Paul Eggert  <eggert@cs.ucla.edu>
+
+       regex: simplify based on Gawk version
+       * lib/regex_internal.c (re_dfa_add_node): Simplify.
+       Reported by Aharon Robbins in
+       <http://sourceware.org/ml/libc-alpha/2012-12/msg00456.html>.
+
 2012-12-29  Paul Eggert  <eggert@cs.ucla.edu>
 
        regex: check that pattern char is single-byte
index cac0190..0042369 100644 (file)
@@ -1443,11 +1443,9 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
   dfa->nodes[dfa->nodes_len] = token;
   dfa->nodes[dfa->nodes_len].constraint = 0;
 #ifdef RE_ENABLE_I18N
-  {
-  int type = token.type;
   dfa->nodes[dfa->nodes_len].accept_mb =
-    (type == OP_PERIOD && dfa->mb_cur_max > 1) || type == COMPLEX_BRACKET;
-  }
+    ((token.type == OP_PERIOD && dfa->mb_cur_max > 1)
+     || token.type == COMPLEX_BRACKET);
 #endif
   dfa->nexts[dfa->nodes_len] = REG_MISSING;
   re_node_set_init_empty (dfa->edests + dfa->nodes_len);