Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175355157
D11506.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D11506.diff
View Options
Index: head/lib/libc/regex/regcomp.c
===================================================================
--- head/lib/libc/regex/regcomp.c
+++ head/lib/libc/regex/regcomp.c
@@ -114,7 +114,7 @@
static int p_branch_eat_delim(struct parse *p, struct branchc *bc);
static void p_branch_ins_offset(struct parse *p, struct branchc *bc);
static void p_branch_fix_tail(struct parse *p, struct branchc *bc);
-static void p_branch_empty(struct parse *p, struct branchc *bc);
+static bool p_branch_empty(struct parse *p, struct branchc *bc);
static bool p_branch_do(struct parse *p, struct branchc *bc);
static void p_bre_pre_parse(struct parse *p, struct branchc *bc);
static void p_bre_post_parse(struct parse *p, struct branchc *bc);
@@ -578,13 +578,15 @@
/*
* Signal to the parser that an empty branch has been encountered; this will,
* in the future, be used to allow for more permissive behavior with empty
- * branches.
+ * branches. The return value should indicate whether parsing may continue
+ * or not.
*/
-static void
+static bool
p_branch_empty(struct parse *p, struct branchc *bc)
{
SETERROR(REG_EMPTY);
+ return (false);
}
/*
@@ -600,7 +602,13 @@
ate = p_branch_eat_delim(p, bc);
if (ate == 0)
return (false);
- (void)REQUIRE(ate == 1 && (!bc->outer || MORE()), REG_EMPTY);
+ else if ((ate > 1 || (bc->outer && !MORE())) && !p_branch_empty(p, bc))
+ /*
+ * Halt parsing only if we have an empty branch and p_branch_empty
+ * indicates that we must not continue. In the future, this will not
+ * necessarily be an error.
+ */
+ return (false);
p_branch_ins_offset(p, bc);
return (true);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 11, 6:05 AM (10 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40588448
Default Alt Text
D11506.diff (1 KB)
Attached To
Mode
D11506: Fix sparc64 libc build after r320742
Attached
Detach File
Event Timeline
Log In to Comment