From owner-p4-projects@FreeBSD.ORG Fri Jun 20 16:14:11 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5048C106568C; Fri, 20 Jun 2008 16:14:11 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 138C71065671 for ; Fri, 20 Jun 2008 16:14:11 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 0E8388FC22 for ; Fri, 20 Jun 2008 16:14:11 +0000 (UTC) (envelope-from gabor@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m5KGEAuK034848 for ; Fri, 20 Jun 2008 16:14:10 GMT (envelope-from gabor@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m5KGEAcp034846 for perforce@freebsd.org; Fri, 20 Jun 2008 16:14:10 GMT (envelope-from gabor@freebsd.org) Date: Fri, 20 Jun 2008 16:14:10 GMT Message-Id: <200806201614.m5KGEAcp034846@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to gabor@freebsd.org using -f From: Gabor Kovesdan To: Perforce Change Reviews Cc: Subject: PERFORCE change 143824 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2008 16:14:11 -0000 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] == '*')