summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2016-08-18 07:43:18 +0000
committerache <ache@FreeBSD.org>2016-08-18 07:43:18 +0000
commit9df3ca0c4ea0f1564e8bd065847c75c7be4b0fb6 (patch)
tree4cdac78781e0750c7b06d6e12fe79c6561e8d812 /bin
parent3b4b8b07bcd6b496a8861ca471cb8c8394315ee7 (diff)
downloadFreeBSD-src-9df3ca0c4ea0f1564e8bd065847c75c7be4b0fb6.zip
FreeBSD-src-9df3ca0c4ea0f1564e8bd065847c75c7be4b0fb6.tar.gz
MFC r302937
Path generation was not according to collate Approved by: jilles
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/expand.c2
-rw-r--r--bin/sh/tests/expansion/Makefile1
-rw-r--r--bin/sh/tests/expansion/pathname1.04
-rw-r--r--bin/sh/tests/expansion/pathname2.04
-rw-r--r--bin/sh/tests/expansion/pathname6.029
5 files changed, 39 insertions, 1 deletions
diff --git a/bin/sh/expand.c b/bin/sh/expand.c
index 6d0d78a..fe72c49 100644
--- a/bin/sh/expand.c
+++ b/bin/sh/expand.c
@@ -1196,7 +1196,7 @@ expsortcmp(const void *p1, const void *p2)
const char *s1 = *(const char * const *)p1;
const char *s2 = *(const char * const *)p2;
- return (strcmp(s1, s2));
+ return (strcoll(s1, s2));
}
diff --git a/bin/sh/tests/expansion/Makefile b/bin/sh/tests/expansion/Makefile
index 1726ff0..eccf239 100644
--- a/bin/sh/tests/expansion/Makefile
+++ b/bin/sh/tests/expansion/Makefile
@@ -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
diff --git a/bin/sh/tests/expansion/pathname1.0 b/bin/sh/tests/expansion/pathname1.0
index 8c6b01c..a4bb093 100644
--- a/bin/sh/tests/expansion/pathname1.0
+++ b/bin/sh/tests/expansion/pathname1.0
@@ -1,5 +1,9 @@
# $FreeBSD$
+unset LC_ALL
+LC_COLLATE=C
+export LC_COLLATE
+
failures=0
check() {
diff --git a/bin/sh/tests/expansion/pathname2.0 b/bin/sh/tests/expansion/pathname2.0
index 8a884ff..5643cf9 100644
--- a/bin/sh/tests/expansion/pathname2.0
+++ b/bin/sh/tests/expansion/pathname2.0
@@ -1,5 +1,9 @@
# $FreeBSD$
+unset LC_ALL
+LC_COLLATE=C
+export LC_COLLATE
+
failures=0
check() {
diff --git a/bin/sh/tests/expansion/pathname6.0 b/bin/sh/tests/expansion/pathname6.0
new file mode 100644
index 0000000..dc425ce
--- /dev/null
+++ b/bin/sh/tests/expansion/pathname6.0
@@ -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))
OpenPOWER on IntegriCloud