]> git.eshelyaron.com Git - emacs.git/commit
Improve robustness of new string-collation code.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 27 Aug 2014 18:56:47 +0000 (11:56 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 27 Aug 2014 18:56:47 +0000 (11:56 -0700)
commit110d87a1cc6a47e31ad9d70cc6366dd81d213860
treed6b77b26ec0ce70df4684c0a859989ff426e3ef5
parent17d94f1ba4333a0d53558af02583dbf80e9157ff
Improve robustness of new string-collation code.

* configure.ac (newlocale): Check for this, not for uselocale.
* src/sysdep.c (LC_COLLATE, LC_COLLATE_MASK, freelocale, locale_t)
(newlocale, wcscoll_l): Define substitutes for platforms that
lack them, so as to simplify the mainline code.
(str_collate): Simplify the code by assuming the above definitions.
Use wcscoll_l, not uselocale, as uselocale is too fragile.  For
example, the old version left the Emacs in the wrong locale if
wcscoll reported an error.  Use 'int', not ptrdiff_t, for the int
result.  Report an error if newlocale fails.

Fixes: debbugs:18051
ChangeLog
configure.ac
src/ChangeLog
src/sysdep.c