PERFORCE change 143817 for review
Gabor Kovesdan
gabor at FreeBSD.org
Fri Jun 20 12:08:57 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=143817
Change 143817 by gabor at gabor_server on 2008/06/20 12:08:52
- GNU compatibility: allow two repetition operators after one another
Affected files ...
.. //depot/projects/soc2008/gabor_textproc/grep/grep.c#27 edit
Differences ...
==== //depot/projects/soc2008/gabor_textproc/grep/grep.c#27 (text+ko) ====
@@ -198,7 +198,13 @@
while (((ptr = strstr(pat, "(|")) != NULL) && (strstr(pat, "(\\|") != ptr) && (strstr(pat, "\\(|") != (ptr - 1))) {
strlcpy(&(ptr[1]), &(ptr[2]), strlen(ptr));
}
- while ((ptr = strstr(pat, "||")) != NULL) {
+ while (((ptr = strstr(pat, "||")) != NULL) && (strstr(pat, "\\||") != (ptr - 1))) {
+ strlcpy(&(ptr[1]), &(ptr[2]), strlen(ptr));
+ }
+ while (((ptr = strstr(pat, "*?")) != NULL) && (strstr(pat, "\\*?") != (ptr - 1))) {
+ strlcpy(&(ptr[1]), &(ptr[2]), strlen(ptr));
+ }
+ while (((ptr = strstr(pat, "?*")) != NULL) && (strstr(pat, "\\?*") != (ptr - 1))) {
strlcpy(&(ptr[1]), &(ptr[2]), strlen(ptr));
}
More information about the p4-projects
mailing list