[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r108701: Fix a bug in w32-get-locale-
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r108701: Fix a bug in w32-get-locale-info. |
Date: |
Sat, 23 Jun 2012 15:44:42 +0300 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 108701
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2012-06-23 15:44:42 +0300
message:
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.
modified:
src/ChangeLog
src/w32proc.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2012-06-23 12:39:23 +0000
+++ b/src/ChangeLog 2012-06-23 12:44:42 +0000
@@ -1,5 +1,8 @@
2012-06-23 Eli Zaretskii <address@hidden>
+ * 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.
=== modified file 'src/w32proc.c'
--- a/src/w32proc.c 2012-06-23 10:22:59 +0000
+++ b/src/w32proc.c 2012-06-23 12:44:42 +0000
@@ -1949,8 +1949,12 @@
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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r108701: Fix a bug in w32-get-locale-info.,
Eli Zaretskii <=