1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 20:32:00 -08:00

* sysdep.c (str_collate): Clear errno just before wcscoll(_l).

One can't hoist this out of the 'if', because intervening calls to
newlocale, twolower, etc. can change errno.
This commit is contained in:
Paul Eggert 2014-08-30 09:47:19 -07:00
parent 4051f5379c
commit 88366fcf88
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2014-08-30 Paul Eggert <eggert@cs.ucla.edu>
* sysdep.c (str_collate): Clear errno just before wcscoll(_l).
One can't hoist this out of the 'if', because intervening calls to
newlocale, twolower, etc. can change errno.
2014-08-30 Eli Zaretskii <eliz@gnu.org>
* sysdep.c (str_collate) [__STDC_ISO_10646__]: Improve the

View file

@ -3740,8 +3740,6 @@ str_collate (Lisp_Object s1, Lisp_Object s2,
FETCH_STRING_CHAR_ADVANCE (*(p2+i-1), s2, i, i_byte);
*(p2+len) = 0;
errno = 0;
if (STRINGP (locale))
{
locale_t loc = newlocale (LC_COLLATE_MASK | LC_CTYPE_MASK,
@ -3757,6 +3755,7 @@ str_collate (Lisp_Object s1, Lisp_Object s2,
*p = towlower_l (*p, loc);
}
errno = 0;
res = wcscoll_l (p1, p2, loc);
err = errno;
freelocale (loc);
@ -3771,6 +3770,7 @@ str_collate (Lisp_Object s1, Lisp_Object s2,
*p = towlower (*p);
}
errno = 0;
res = wcscoll (p1, p2);
err = errno;
}