[Bug 240118] New: libc regex.h REG_NEWLINE broken
https://bugzilla.novell.com/show_bug.cgi?id=240118 Summary: libc regex.h REG_NEWLINE broken Product: openSUSE 10.2 Version: Final Platform: i686 OS/Version: Linux Status: NEW Severity: Normal Priority: P5 - None Component: Development AssignedTo: pth@novell.com ReportedBy: gatoatigrado@myrealbox.com QAContact: qa@suse.de The GNU project page said to report bugs to distributions as they sometimes modify libc. I don't think this is the case, but I have received good responses here before. In this case, compiling a regex without REG_NEWLINE from regex.h doesn't do what it is supposed to - match "^" and "$" to the newline characters. I tried compiling it with REG_NEWLINE (as anyone should), and it didn't work either. Some excerpted C code (I can attach the whole project if you really want...) regex_t boardsize_regex, number_regex; // FIXME: for some reason, cannot add "$" to end of regex or it will not match. // Flag REG_NEWLINE is broken, should work if not set (force with "... & (~REG_NEWLINE)" doesn't work) if((regcomp(&boardsize_regex, "^P1 ([0-9]+) ([0-9]+)$", REG_EXTENDED) != 0)) { fprintf(stderr, "could not compile regex. Please check regex.h; the regex" " expression \"\\d+\" is hard coded and should work.\n"); exit(1); } then try to match "P1 0 0\n" or "\nP1 0 0" with regmatch_t regex_board_size_match[3]; if(regexec(&boardsize_regex, "P1 30 30\n", 3, regex_board_size_match, 0)) { fprintf(stderr, "could not find the identifier for the board. Please make sure it follows the syntax" " \"^P1 ([0-9]+) ([0-9]+)\". Thank you.\n"); exit(1); } the second line will print an error. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=240118 gatoatigrado@myrealbox.com changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|libc regex.h REG_NEWLINE |libc regex.h REG_NEWLINE broken (?) |broken | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=240118 User pbaudis@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=240118#c3 Petr Baudis <pbaudis@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WORKSFORME --- Comment #3 from Petr Baudis <pbaudis@novell.com> 2008-07-06 01:24:27 MDT --- This works in 11.0. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com