diff options
Diffstat (limited to 'lib/libc/gen')
-rw-r--r-- | lib/libc/gen/opendir.c | 4 | ||||
-rw-r--r-- | lib/libc/gen/scandir.c | 8 |
2 files changed, 4 insertions, 8 deletions
diff --git a/lib/libc/gen/opendir.c b/lib/libc/gen/opendir.c index c192ab2..d99faa4 100644 --- a/lib/libc/gen/opendir.c +++ b/lib/libc/gen/opendir.c @@ -94,13 +94,13 @@ __opendir2(const char *name, int flags) /* * POSIX 2008 and XSI 7 require alphasort() to call strcoll() for - * directory entries ordering. Use local copy that uses strcmp(). + * directory entries ordering. */ static int opendir_alphasort(const void *p1, const void *p2) { - return (strcmp((*(const struct dirent **)p1)->d_name, + return (strcoll((*(const struct dirent **)p1)->d_name, (*(const struct dirent **)p2)->d_name)); } diff --git a/lib/libc/gen/scandir.c b/lib/libc/gen/scandir.c index b6f76ba..2c86aa5 100644 --- a/lib/libc/gen/scandir.c +++ b/lib/libc/gen/scandir.c @@ -127,17 +127,13 @@ fail: /* * Alphabetic order comparison routine for those who want it. * - * XXXKIB POSIX 2008 requires the alphasort() to use strcoll(). Keep - * strcmp() for now, since environment locale settings could have no - * relevance for the byte sequence of the file name. Moreover, it - * might be even invalid sequence in current locale, and then - * behaviour of alphasort would be undefined. + * POSIX 2008 requires the alphasort() to use strcoll(). */ int alphasort(const struct dirent **d1, const struct dirent **d2) { - return (strcmp((*d1)->d_name, (*d2)->d_name)); + return (strcoll((*d1)->d_name, (*d2)->d_name)); } static int |