Commit 7421589f authored by Paul Eggert's avatar Paul Eggert

* sysdep.c (str_collate): Do not look at errno after towlower_l.

errno's value is not specified after towlower_l.  Instead, assume
that towlower_l returns its argument on failure, which is portable
in practice.
parent 21ba51de
2014-08-29 Paul Eggert <eggert@cs.ucla.edu>
* sysdep.c (str_collate): Do not look at errno after towlower_l.
errno's value is not specified after towlower_l. Instead, assume
that towlower_l returns its argument on failure, which is portable
in practice.
2014-08-29 Eli Zaretskii <eliz@gnu.org>
* fns.c (Fstring_collate_lessp, Fstring_collate_equalp): Doc fix.
......
......@@ -3746,24 +3746,16 @@ str_collate (Lisp_Object s1, Lisp_Object s2,
SSDATA (locale), 0);
if (!loc)
error ("Wrong locale: %s", strerror (errno));
errno = 0;
if (! NILP (ignore_case))
for (int i = 1; i < 3; i++)
{
wchar_t *p = (i == 1) ? p1 : p2;
for (; *p; p++)
{
*p = towlower_l (*p, loc);
if (errno)
break;
}
if (errno)
break;
*p = towlower_l (*p, loc);
}
if (! errno)
res = wcscoll_l (p1, p2, loc);
res = wcscoll_l (p1, p2, loc);
err = errno;
freelocale (loc);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment