diff options
| author | Paul Eggert | 2015-08-27 04:09:11 -0700 |
|---|---|---|
| committer | Paul Eggert | 2015-08-27 04:09:30 -0700 |
| commit | f33c164123e2bc46c4d06853b1a32130126d54c8 (patch) | |
| tree | 8575f6afb8836382842ed6757afe511d0c942fcb /src | |
| parent | 2934c21f2d74d9043420db1661704f080718873a (diff) | |
| download | emacs-f33c164123e2bc46c4d06853b1a32130126d54c8.tar.gz emacs-f33c164123e2bc46c4d06853b1a32130126d54c8.zip | |
Fix ‘format’ bug with property offsets
* src/editfns.c (styled_format): Fix recently-introduced ‘format’
bug in calculating string property offsets (Bug#21351).
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/editfns.c b/src/editfns.c index 9db4d9328a0..bbb139f2980 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -4013,10 +4013,14 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) | |||
| 4013 | error ("Format string ends in middle of format specifier"); | 4013 | error ("Format string ends in middle of format specifier"); |
| 4014 | 4014 | ||
| 4015 | memset (&discarded[format0 - format_start], 1, format - format0); | 4015 | memset (&discarded[format0 - format_start], 1, format - format0); |
| 4016 | conversion = *format++; | 4016 | conversion = *format; |
| 4017 | if (conversion == '%') | 4017 | if (conversion == '%') |
| 4018 | goto copy_char; | 4018 | { |
| 4019 | format++; | ||
| 4020 | goto copy_char; | ||
| 4021 | } | ||
| 4019 | discarded[format - format_start] = 1; | 4022 | discarded[format - format_start] = 1; |
| 4023 | format++; | ||
| 4020 | 4024 | ||
| 4021 | ++n; | 4025 | ++n; |
| 4022 | if (! (n < nargs)) | 4026 | if (! (n < nargs)) |