diff options
| author | Eli Zaretskii | 2012-06-23 15:44:42 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2012-06-23 15:44:42 +0300 |
| commit | 965125550937ce450c74effa9c13262db3adf48b (patch) | |
| tree | bee6c6bf1ee51f2358e087a485d21af3825ef0c1 /src | |
| parent | 0bd8297f9cee150f34cbab14c71825d21d7bf91c (diff) | |
| download | emacs-965125550937ce450c74effa9c13262db3adf48b.tar.gz emacs-965125550937ce450c74effa9c13262db3adf48b.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/w32proc.c | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index a01a93f86e9..b23e92057b0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2012-06-23 Eli Zaretskii <eliz@gnu.org> | 1 | 2012-06-23 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in | ||
| 4 | last argument of make_unibyte_string. | ||
| 5 | |||
| 3 | * keyboard.c (kbd_buffer_get_event): Include the codepage and the | 6 | * keyboard.c (kbd_buffer_get_event): Include the codepage and the |
| 4 | language ID in the event parameters. | 7 | language ID in the event parameters. |
| 5 | 8 | ||
diff --git a/src/w32proc.c b/src/w32proc.c index 55b9ee1ec0e..2f5f39e68b3 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -1949,8 +1949,12 @@ If LCID (a 16-bit number) is not a valid locale, the result is nil. */) | |||
| 1949 | got_full = GetLocaleInfo (XINT (lcid), | 1949 | got_full = GetLocaleInfo (XINT (lcid), |
| 1950 | XINT (longform), | 1950 | XINT (longform), |
| 1951 | full_name, sizeof (full_name)); | 1951 | full_name, sizeof (full_name)); |
| 1952 | /* GetLocaleInfo's return value includes the terminating null | ||
| 1953 | character, when the returned information is a string, whereas | ||
| 1954 | make_unibyte_string needs the string length without the | ||
| 1955 | terminating null. */ | ||
| 1952 | if (got_full) | 1956 | if (got_full) |
| 1953 | return make_unibyte_string (full_name, got_full); | 1957 | return make_unibyte_string (full_name, got_full - 1); |
| 1954 | } | 1958 | } |
| 1955 | 1959 | ||
| 1956 | return Qnil; | 1960 | return Qnil; |