From owner-svn-src-all@freebsd.org Sat Jul 16 13:26:20 2016 Return-Path: Delivered-To: svn-src-all@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 05CEAB9A824; Sat, 16 Jul 2016 13:26:20 +0000 (UTC) (envelope-from ache@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 B7EA61881; Sat, 16 Jul 2016 13:26:19 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6GDQI3L088489; Sat, 16 Jul 2016 13:26:18 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6GDQIgG088484; Sat, 16 Jul 2016 13:26:18 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201607161326.u6GDQIgG088484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Sat, 16 Jul 2016 13:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302937 - in head/bin/sh: . tests/expansion X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jul 2016 13:26:20 -0000 Author: ache Date: Sat Jul 16 13:26:18 2016 New Revision: 302937 URL: https://svnweb.freebsd.org/changeset/base/302937 Log: Path generation was not according to collate Approved by: jilles Added: head/bin/sh/tests/expansion/pathname6.0 (contents, props changed) Modified: head/bin/sh/expand.c head/bin/sh/tests/expansion/Makefile head/bin/sh/tests/expansion/pathname1.0 head/bin/sh/tests/expansion/pathname2.0 Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Sat Jul 16 13:24:58 2016 (r302936) +++ head/bin/sh/expand.c Sat Jul 16 13:26:18 2016 (r302937) @@ -1196,7 +1196,7 @@ expsortcmp(const void *p1, const void *p const char *s1 = *(const char * const *)p1; const char *s2 = *(const char * const *)p2; - return (strcmp(s1, s2)); + return (strcoll(s1, s2)); } Modified: head/bin/sh/tests/expansion/Makefile ============================================================================== --- head/bin/sh/tests/expansion/Makefile Sat Jul 16 13:24:58 2016 (r302936) +++ head/bin/sh/tests/expansion/Makefile Sat Jul 16 13:26:18 2016 (r302937) @@ -66,6 +66,7 @@ ${PACKAGE}FILES+= pathname2.0 ${PACKAGE}FILES+= pathname3.0 ${PACKAGE}FILES+= pathname4.0 ${PACKAGE}FILES+= pathname5.0 +${PACKAGE}FILES+= pathname6.0 ${PACKAGE}FILES+= plus-minus1.0 ${PACKAGE}FILES+= plus-minus2.0 ${PACKAGE}FILES+= plus-minus3.0 Modified: head/bin/sh/tests/expansion/pathname1.0 ============================================================================== --- head/bin/sh/tests/expansion/pathname1.0 Sat Jul 16 13:24:58 2016 (r302936) +++ head/bin/sh/tests/expansion/pathname1.0 Sat Jul 16 13:26:18 2016 (r302937) @@ -1,5 +1,9 @@ # $FreeBSD$ +unset LC_ALL +LC_COLLATE=C +export LC_COLLATE + failures=0 check() { Modified: head/bin/sh/tests/expansion/pathname2.0 ============================================================================== --- head/bin/sh/tests/expansion/pathname2.0 Sat Jul 16 13:24:58 2016 (r302936) +++ head/bin/sh/tests/expansion/pathname2.0 Sat Jul 16 13:26:18 2016 (r302937) @@ -1,5 +1,9 @@ # $FreeBSD$ +unset LC_ALL +LC_COLLATE=C +export LC_COLLATE + failures=0 check() { Added: head/bin/sh/tests/expansion/pathname6.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/expansion/pathname6.0 Sat Jul 16 13:26:18 2016 (r302937) @@ -0,0 +1,29 @@ +# $FreeBSD$ + +unset LC_ALL +LC_COLLATE=en_US.US-ASCII +export LC_COLLATE + +failures=0 + +check() { + testcase=$1 + expect=$2 + eval "set -- $testcase" + actual="$*" + if [ "$actual" != "$expect" ]; then + failures=$((failures+1)) + printf '%s\n' "For $testcase, expected $expect actual $actual" + fi +} + +set -e +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) +trap 'rm -rf $T' 0 +cd -P $T + +touch A B a b + +check '*' 'a A b B' + +exit $((failures != 0))