This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] another small regex cleanup


This cannot harm.

Paolo

2003-12-14 Paolo Bonzini <bonzini@gnu.org>

* libc/regexec.c (check_arrival): remove duplicate test.
--- sed-4.0.9/lib/regexec.c	2003-12-15 12:15:57.000000000 +0100
+++ sed-4.0b/lib/regexec.c	2003-12-15 12:57:39.000000000 +0100
@@ -2819,12 +2819,11 @@ check_arrival
   mctx->state_log = backup_state_log;
   mctx->input->cur_idx = backup_cur_idx;
 
-  if (cur_nodes == NULL)
-    return REG_NOMATCH;
   /* Then check the current node set has the node LAST_NODE.  */
-  return (re_node_set_contains (cur_nodes, last_node)
-	  || re_node_set_contains (cur_nodes, last_node) ? REG_NOERROR
-	  : REG_NOMATCH);
+  if (cur_nodes && re_node_set_contains (cur_nodes, last_node))
+    return REG_NOERROR;
+  else
+    return REG_NOMATCH;
 }
 
 /* Helper functions for check_arrival.  */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]