diff options
author | Eli Zaretskii <eliz@gnu.org> | 2014-08-30 11:19:24 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2014-08-30 11:19:24 +0300 |
commit | e7027eab55d9b3b63ddc1c26f3e222692c8c9499 (patch) | |
tree | 62f5b2569c009499c0c5ff5c896a0df9b4b49f30 /src/w32proc.c | |
parent | e1a9bbbd4f719a2256bd180ae9e9fffb64db63e4 (diff) | |
download | emacs-e7027eab55d9b3b63ddc1c26f3e222692c8c9499.tar.gz |
Improve error checking and error messages in string-collation functions.
src/sysdep.c (str_collate) [__STDC_ISO_10646__]: Improve the
wording of the error messages.
(str_collate) [WINDOWSNT]: Signal an error if w32_compare_strings
sets errno.
src/w32proc.c (get_lcid_callback): Accept locale specifications
without the country part, as in "enu" vs "enu_USA".
(w32_compare_strings): Signal an error if a locale was specified,
but couldn't be translated into a valid LCID.
Diffstat (limited to 'src/w32proc.c')
-rw-r--r-- | src/w32proc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/w32proc.c b/src/w32proc.c index 0b441d45186..399ed009ce3 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -3164,6 +3164,12 @@ get_lcid_callback (LPTSTR locale_num_str) if (GetLocaleInfo (try_lcid, LOCALE_SABBREVLANGNAME, locval, LOCALE_NAME_MAX_LENGTH)) { + /* This is for when they only specify the language, as in "ENU". */ + if (stricmp (locval, lname) == 0) + { + found_lcid = try_lcid; + return FALSE; + } strcat (locval, "_"); if (GetLocaleInfo (try_lcid, LOCALE_SABBREVCTRYNAME, locval + strlen (locval), LOCALE_NAME_MAX_LENGTH)) @@ -3287,6 +3293,8 @@ w32_compare_strings (const char *s1, const char *s2, char *locname, if (new_lcid > 0) lcid = new_lcid; + else + error ("Invalid locale %s: Invalid argument", locname); } if (ignore_case) |