From 3e5a48af5e1ecf1c3e1129c760128c3f6d479b57 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 11 Jun 2012 22:15:27 +0000 Subject: [PATCH] * regex/regcomp.c (p_ere): Allow vertical-line following left-parenthesis in ERE, as in glibc. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/regex/regcomp.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d5a226f0b..dff98bf06 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2012-06-11 Yaakov Selkowitz + + * regex/regcomp.c (p_ere): Allow vertical-line following + left-parenthesis in ERE, as in glibc. + 2012-06-10 Yaakov Selkowitz * include/sys/elf_common.h (R_386_16): Define. diff --git a/winsup/cygwin/regex/regcomp.c b/winsup/cygwin/regex/regcomp.c index 30502f7f1..b44ba2c62 100644 --- a/winsup/cygwin/regex/regcomp.c +++ b/winsup/cygwin/regex/regcomp.c @@ -324,7 +324,10 @@ p_ere(struct parse *p, conc = HERE(); while (MORE() && (c = PEEK()) != '|' && c != stop) p_ere_exp(p); +#ifndef __CYGWIN__ + /* undefined behaviour according to POSIX; allowed by glibc */ (void)REQUIRE(HERE() != conc, REG_EMPTY); /* require nonempty */ +#endif if (!EAT('|')) break; /* NOTE BREAK OUT */