Commit 96512555 authored by Eli Zaretskii's avatar Eli Zaretskii

Fix a bug in w32-get-locale-info.

 src/w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
 last argument of make_unibyte_string.
parent 0bd8297f
2012-06-23 Eli Zaretskii <eliz@gnu.org>
* w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
last argument of make_unibyte_string.
* keyboard.c (kbd_buffer_get_event): Include the codepage and the
language ID in the event parameters.
......
......@@ -1949,8 +1949,12 @@ If LCID (a 16-bit number) is not a valid locale, the result is nil. */)
got_full = GetLocaleInfo (XINT (lcid),
XINT (longform),
full_name, sizeof (full_name));
/* GetLocaleInfo's return value includes the terminating null
character, when the returned information is a string, whereas
make_unibyte_string needs the string length without the
terminating null. */
if (got_full)
return make_unibyte_string (full_name, got_full);
return make_unibyte_string (full_name, got_full - 1);
}
return Qnil;
......
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