Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jun 2008 16:14:10 GMT
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 143824 for review
Message-ID:  <200806201614.m5KGEAcp034846@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=143824

Change 143824 by gabor@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] == '*')



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806201614.m5KGEAcp034846>