Path generation was not according to collate

Approved by:    jilles
This commit is contained in:
Andrey A. Chernov 2016-07-16 13:26:18 +00:00
parent 86f1146329
commit 143d321a30
5 changed files with 39 additions and 1 deletions

View File

@ -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));
}

View File

@ -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

View File

@ -1,5 +1,9 @@
# $FreeBSD$
unset LC_ALL
LC_COLLATE=C
export LC_COLLATE
failures=0
check() {

View File

@ -1,5 +1,9 @@
# $FreeBSD$
unset LC_ALL
LC_COLLATE=C
export LC_COLLATE
failures=0
check() {

View File

@ -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))