summaryrefslogtreecommitdiff
path: root/src/sysdep.c
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2014-08-29 23:19:45 +0200
committerMichael Albinus <michael.albinus@gmx.de>2014-08-29 23:19:45 +0200
commitfb6cdfc0f0692ead110ecd80df52f894fca8fb50 (patch)
treec95414bf0553b291a41eacac4091c51904264263 /src/sysdep.c
parente6a4c15ff1a2dad24eb695d0f9f1e63398aadf9f (diff)
downloademacs-fb6cdfc0f0692ead110ecd80df52f894fca8fb50.tar.gz
* sysdep.c (str_collate) [__STDC_ISO_10646__]: Move up setting errno.
Diffstat (limited to 'src/sysdep.c')
-rw-r--r--src/sysdep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sysdep.c b/src/sysdep.c
index d36f5b29b08..e1da2f87eb2 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -3740,6 +3740,8 @@ 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,
@@ -3761,7 +3763,6 @@ str_collate (Lisp_Object s1, Lisp_Object s2,
}
else
{
- errno = 0;
if (! NILP (ignore_case))
for (int i = 1; i < 3; i++)
{
@@ -3769,6 +3770,7 @@ str_collate (Lisp_Object s1, Lisp_Object s2,
for (; *p; p++)
*p = towlower (*p);
}
+
res = wcscoll (p1, p2);
err = errno;
}