Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 16 Jul 2016 13:26:18 +0000 (UTC)
From:      "Andrey A. Chernov" <ache@FreeBSD.org>
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
Message-ID:  <201607161326.u6GDQIgG088484@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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))



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