add a multibyte case-insensitive version of strcoll(), and make

diralphasort() use it so that filenames are sorted properly according to
the current locale


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2743 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
David Lawrence Ramsey
2005-06-21 03:26:58 +00:00
parent 6c25819c34
commit d0c4d378b4
6 changed files with 145 additions and 10 deletions

View File

@@ -1994,7 +1994,8 @@ char *real_dir_from_tilde(const char *buf)
#if !defined(DISABLE_TABCOMP) || !defined(DISABLE_BROWSER)
/* Our sort routine for file listings. Sort alphabetically and
* case-insensitively, and sort directories before filenames. */
* case-insensitively (taking the locale into account), and sort
* directories before filenames. */
int diralphasort(const void *va, const void *vb)
{
struct stat fileinfo;
@@ -2008,7 +2009,7 @@ int diralphasort(const void *va, const void *vb)
if (!aisdir && bisdir)
return 1;
return mbstrcasecmp(a, b);
return mbstrcasecoll(a, b);
}
/* Free the memory allocated for array, which should contain len