diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index b6d9094e684..adc0f4d7e0a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -27755,7 +27755,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, | |||
| 27755 | case Lisp_String: | 27755 | case Lisp_String: |
| 27756 | { | 27756 | { |
| 27757 | /* A string: output it and check for %-constructs within it. */ | 27757 | /* A string: output it and check for %-constructs within it. */ |
| 27758 | unsigned char c; | 27758 | int c; |
| 27759 | ptrdiff_t offset = 0; | 27759 | ptrdiff_t offset = 0; |
| 27760 | 27760 | ||
| 27761 | if (SCHARS (elt) > 0 | 27761 | if (SCHARS (elt) > 0 |
| @@ -27926,6 +27926,15 @@ display_mode_element (struct it *it, int depth, int field_width, int precision, | |||
| 27926 | while ((c = SREF (elt, offset++)) >= '0' && c <= '9') | 27926 | while ((c = SREF (elt, offset++)) >= '0' && c <= '9') |
| 27927 | field = field * 10 + c - '0'; | 27927 | field = field * 10 + c - '0'; |
| 27928 | 27928 | ||
| 27929 | /* "%" could be followed by a multibyte character. */ | ||
| 27930 | if (STRING_MULTIBYTE (elt)) | ||
| 27931 | { | ||
| 27932 | int length; | ||
| 27933 | offset--; | ||
| 27934 | c = string_char_and_length (SDATA (elt) + offset, &length); | ||
| 27935 | offset += length; | ||
| 27936 | } | ||
| 27937 | |||
| 27929 | /* Don't pad beyond the total padding allowed. */ | 27938 | /* Don't pad beyond the total padding allowed. */ |
| 27930 | if (field_width - n > 0 && field > field_width - n) | 27939 | if (field_width - n > 0 && field > field_width - n) |
| 27931 | field = field_width - n; | 27940 | field = field_width - n; |