PERFORCE change 143824 for review
Gabor Kovesdan
gabor at FreeBSD.org
Fri Jun 20 16:14:11 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=143824
Change 143824 by gabor at gabor_server on 2008/06/20 16:13:19
- GNU compatibility: some * and ? token manipulations to
provide better GNU compatibility
Affected files ...
.. //depot/projects/soc2008/gabor_textproc/grep/grep.c#28 edit
Differences ...
==== //depot/projects/soc2008/gabor_textproc/grep/grep.c#28 (text+ko) ====
@@ -207,6 +207,20 @@
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)) && (strstr(pat, "\\(**") != (ptr - 2))) {
+ 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) {
+ strlcpy(&(ptr[1]), &(ptr[2]), strlen(ptr));
+ }
+ while ((ptr = strstr(pat, "(*")) != NULL && (strstr(pat, "\\(*") != (ptr - 1))) {
+ strlcpy(&(ptr[1]), &(ptr[2]), strlen(ptr));
+ }
+
+// printf("PAT %s\n", pat);
/* Work-around to allow * at the beginning of the regexp */
while (pat[0] == '*')
More information about the p4-projects
mailing list