public inbox for glibc-bugs-regex@sourceware.org
help / color / mirror / Atom feed
* [Bug regex/3957] New: regcomp with REG_NEWLINE flag does operate as POSIX specification for a non-matching list
@ 2007-02-02 13:23 andrew dot mackey at baesystems dot com
2007-02-05 13:43 ` [Bug regex/3957] " jakub at redhat dot com
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: andrew dot mackey at baesystems dot com @ 2007-02-02 13:23 UTC (permalink / raw)
To: glibc-bugs-regex
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2639 bytes --]
Given the string foo\nbar (where \n is a linefeed) the regular expression
foo[^ ]+ matches the complete string. The regex is compiled with REG_EXTENDED
and REG_NEWLINE flags.
The POSIX specification at
http://www.opengroup.org/onlinepubs/009695399/functions/regcomp.html
Says for the REG_NEWLINE flag that
A <newline> in string shall not be matched by a period outside a bracket
expression or by any form of a non-matching list
For older versions of glicb (glibc-2.1.3) the behaviour of regcomp is as the
POSIX specification. For glibc-2.5 and from at least glibc-2.3.2 this is not
the behaviour
The following code demonstrates the issue
#include <stdio.h>
#include <sys/types.h>
#include <regex.h>
int main(int argc, char **argv)
{
char regex[] = "foo[^ ]+";
char text[] = "foo\nbar";
regex_t preg;
regmatch_t pmatch[1];
int flags = REG_EXTENDED | REG_NEWLINE;
int i;
printf("About to compile regexp '%s', with flags %d\n", regex, flags);
if(!regcomp(&preg, regex, flags))
{
printf("About to search string '%s'\n", text);
if(!regexec(&preg, text, 1, pmatch, 0))
{
printf("Regex matched, match text is '");
for(i = pmatch[0].rm_so; i < pmatch[0].rm_eo; i++)
{
printf("%c", text[i]);
}
printf("'\n");
}
else
{
printf("Regex did not match\n");
}
regfree(&preg);
}
else
{
printf("Failed to compile regex\n");
}
return 0;
}
On glib-2.3.2, glibc-2.3.6 or glibc-2.5 the program gives
About to compile regexp 'foo[^ ]+', with flags 5
About to search string 'foo
bar'
Regex matched, match text is 'foo
bar'
On glibc-2.1.3 and other C libraries such as found on Solaris 9 the output is
About to compile regexp 'foo[^ ]+', with flags 9
About to search string 'foo
bar'
Regex did not match
Which I believe is the expected POISX behaviour.
--
Summary: regcomp with REG_NEWLINE flag does operate as POSIX
specification for a non-matching list
Product: glibc
Version: 2.4
Status: NEW
Severity: normal
Priority: P2
Component: regex
AssignedTo: drepper at redhat dot com
ReportedBy: andrew dot mackey at baesystems dot com
CC: andrew dot mackey at baesystems dot com,glibc-bugs-regex
at sources dot redhat dot com,glibc-bugs at sources dot
redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=3957
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug regex/3957] regcomp with REG_NEWLINE flag does operate as POSIX specification for a non-matching list
2007-02-02 13:23 [Bug regex/3957] New: regcomp with REG_NEWLINE flag does operate as POSIX specification for a non-matching list andrew dot mackey at baesystems dot com
@ 2007-02-05 13:43 ` jakub at redhat dot com
2007-02-05 15:24 ` drepper at redhat dot com
2007-07-12 14:50 ` cvs-commit at gcc dot gnu dot org
2 siblings, 0 replies; 6+ messages in thread
From: jakub at redhat dot com @ 2007-02-05 13:43 UTC (permalink / raw)
To: glibc-bugs-regex
------- Additional Comments From jakub at redhat dot com 2007-02-05 13:42 -------
Testing a fix.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|drepper at redhat dot com |jakub at redhat dot com
Status|NEW |ASSIGNED
Summary|regcomp with REG_NEWLINE |regcomp with REG_NEWLINE
|flag does operate as POSIX |flag does operate as POSIX
|specification for a non- |specification for a non-
|matching list |matching list
http://sourceware.org/bugzilla/show_bug.cgi?id=3957
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug regex/3957] regcomp with REG_NEWLINE flag does operate as POSIX specification for a non-matching list
2007-02-02 13:23 [Bug regex/3957] New: regcomp with REG_NEWLINE flag does operate as POSIX specification for a non-matching list andrew dot mackey at baesystems dot com
2007-02-05 13:43 ` [Bug regex/3957] " jakub at redhat dot com
@ 2007-02-05 15:24 ` drepper at redhat dot com
2007-07-12 14:50 ` cvs-commit at gcc dot gnu dot org
2 siblings, 0 replies; 6+ messages in thread
From: drepper at redhat dot com @ 2007-02-05 15:24 UTC (permalink / raw)
To: glibc-bugs-regex
------- Additional Comments From drepper at redhat dot com 2007-02-05 15:24 -------
Fixed upstream.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://sourceware.org/bugzilla/show_bug.cgi?id=3957
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug regex/3957] regcomp with REG_NEWLINE flag does operate as POSIX specification for a non-matching list
2007-02-02 13:23 [Bug regex/3957] New: regcomp with REG_NEWLINE flag does operate as POSIX specification for a non-matching list andrew dot mackey at baesystems dot com
2007-02-05 13:43 ` [Bug regex/3957] " jakub at redhat dot com
2007-02-05 15:24 ` drepper at redhat dot com
@ 2007-07-12 14:50 ` cvs-commit at gcc dot gnu dot org
2 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2007-07-12 14:50 UTC (permalink / raw)
To: glibc-bugs-regex
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2007-07-12 14:50 -------
Subject: Bug 3957
CVSROOT: /cvs/glibc
Module name: libc
Branch: glibc-2_5-branch
Changes by: jakub@sourceware.org 2007-07-12 14:50:17
Modified files:
. : ChangeLog
posix : Makefile regcomp.c
Added files:
posix : bug-regex27.c bug-regex28.c
Log message:
2007-02-05 Jakub Jelinek <jakub@redhat.com>
[BZ #3957]
* posix/regcomp.c (parse_bracket_exp): Set '\n' bit rather than '\0'
bit for RE_HAT_LISTS_NOT_NEWLINE.
(build_charclass_op): Remove bogus comment.
* posix/Makefile (tests): Add bug-regex27 and bug-regex28.
* posix/bug-regex27.c: New test.
* posix/bug-regex28.c: New test.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.10362.2.39&r2=1.10362.2.40
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/posix/bug-regex27.c.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=NONE&r2=1.1.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/posix/bug-regex28.c.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=NONE&r2=1.1.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/posix/Makefile.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.193.2.1&r2=1.193.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/posix/regcomp.c.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.112&r2=1.112.2.1
--
http://sourceware.org/bugzilla/show_bug.cgi?id=3957
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug regex/3957] regcomp with REG_NEWLINE flag does operate as POSIX specification for a non-matching list
[not found] <bug-3957-132@http.sourceware.org/bugzilla/>
2014-02-16 17:44 ` jackie.rosen at hushmail dot com
@ 2014-05-28 19:41 ` schwab at sourceware dot org
1 sibling, 0 replies; 6+ messages in thread
From: schwab at sourceware dot org @ 2014-05-28 19:41 UTC (permalink / raw)
To: glibc-bugs-regex
https://sourceware.org/bugzilla/show_bug.cgi?id=3957
Andreas Schwab <schwab at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|jackie.rosen at hushmail dot com |
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug regex/3957] regcomp with REG_NEWLINE flag does operate as POSIX specification for a non-matching list
[not found] <bug-3957-132@http.sourceware.org/bugzilla/>
@ 2014-02-16 17:44 ` jackie.rosen at hushmail dot com
2014-05-28 19:41 ` schwab at sourceware dot org
1 sibling, 0 replies; 6+ messages in thread
From: jackie.rosen at hushmail dot com @ 2014-02-16 17:44 UTC (permalink / raw)
To: glibc-bugs-regex
https://sourceware.org/bugzilla/show_bug.cgi?id=3957
Jackie Rosen <jackie.rosen at hushmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jackie.rosen at hushmail dot com
--- Comment #4 from Jackie Rosen <jackie.rosen at hushmail dot com> ---
*** Bug 260998 has been marked as a duplicate of this bug. ***
Seen from the domain http://volichat.com
Page where seen: http://volichat.com/adult-chat-rooms
Marked for reference. Resolved as fixed @bugzilla.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-05-28 19:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-02 13:23 [Bug regex/3957] New: regcomp with REG_NEWLINE flag does operate as POSIX specification for a non-matching list andrew dot mackey at baesystems dot com
2007-02-05 13:43 ` [Bug regex/3957] " jakub at redhat dot com
2007-02-05 15:24 ` drepper at redhat dot com
2007-07-12 14:50 ` cvs-commit at gcc dot gnu dot org
[not found] <bug-3957-132@http.sourceware.org/bugzilla/>
2014-02-16 17:44 ` jackie.rosen at hushmail dot com
2014-05-28 19:41 ` schwab at sourceware dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).