From owner-svn-src-head@freebsd.org Fri Apr 21 22:19:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8304ED49CEF; Fri, 21 Apr 2017 22:19:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39EA51F02; Fri, 21 Apr 2017 22:19:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LMJEg9029096; Fri, 21 Apr 2017 22:19:14 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LMJEYt029093; Fri, 21 Apr 2017 22:19:14 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201704212219.v3LMJEYt029093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 21 Apr 2017 22:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317274 - in head/contrib/bmake: . unit-tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Apr 2017 22:19:15 -0000 Author: sjg Date: Fri Apr 21 22:19:13 2017 New Revision: 317274 URL: https://svnweb.freebsd.org/changeset/base/317274 Log: Str_Match: fix closure tests for [^] and add unit-test. Modified: head/contrib/bmake/str.c head/contrib/bmake/unit-tests/modmatch.exp head/contrib/bmake/unit-tests/modmatch.mk Modified: head/contrib/bmake/str.c ============================================================================== --- head/contrib/bmake/str.c Fri Apr 21 22:00:22 2017 (r317273) +++ head/contrib/bmake/str.c Fri Apr 21 22:19:13 2017 (r317274) @@ -382,8 +382,11 @@ Str_Match(const char *string, const char } else nomatch = 0; for (;;) { - if ((*pattern == ']') || (*pattern == 0)) - return(nomatch); + if ((*pattern == ']') || (*pattern == 0)) { + if (nomatch) + break; + return(0); + } if (*pattern == *string) break; if (pattern[1] == '-') { @@ -400,7 +403,7 @@ Str_Match(const char *string, const char } ++pattern; } - if (nomatch) + if (nomatch && (*pattern != ']') && (*pattern != 0)) return 0; while ((*pattern != ']') && (*pattern != 0)) ++pattern; Modified: head/contrib/bmake/unit-tests/modmatch.exp ============================================================================== --- head/contrib/bmake/unit-tests/modmatch.exp Fri Apr 21 22:00:22 2017 (r317273) +++ head/contrib/bmake/unit-tests/modmatch.exp Fri Apr 21 22:19:13 2017 (r317274) @@ -16,4 +16,5 @@ LIB=e X_LIBS:M*/lib${LIB}.a:tu is "/TMP/ Mscanner=OK Upper=One Two Three Four Lower=five six seven +nose=One Three five exit status 0 Modified: head/contrib/bmake/unit-tests/modmatch.mk ============================================================================== --- head/contrib/bmake/unit-tests/modmatch.mk Fri Apr 21 22:00:22 2017 (r317273) +++ head/contrib/bmake/unit-tests/modmatch.mk Fri Apr 21 22:19:13 2017 (r317274) @@ -31,3 +31,4 @@ LIST= One Two Three Four five six seven check-cclass: @echo Upper=${LIST:M[A-Z]*} @echo Lower=${LIST:M[^A-Z]*} + @echo nose=${LIST:M[^s]*[ex]}