summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2015-08-27 04:09:11 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2015-08-27 04:09:30 -0700
commitf33c164123e2bc46c4d06853b1a32130126d54c8 (patch)
tree8575f6afb8836382842ed6757afe511d0c942fcb /src
parent2934c21f2d74d9043420db1661704f080718873a (diff)
downloademacs-f33c164123e2bc46c4d06853b1a32130126d54c8.tar.gz
emacs-f33c164123e2bc46c4d06853b1a32130126d54c8.tar.bz2
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.c8
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)
error ("Format string ends in middle of format specifier");
memset (&discarded[format0 - format_start], 1, format - format0);
- conversion = *format++;
+ conversion = *format;
if (conversion == '%')
- goto copy_char;
+ {
+ format++;
+ goto copy_char;
+ }
discarded[format - format_start] = 1;
+ format++;
++n;
if (! (n < nargs))