From: Paul Eggert Date: Thu, 15 Sep 2011 18:11:37 +0000 (-0700) Subject: * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514). X-Git-Tag: emacs-pretest-24.0.90~104^2~27 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7812ba2dea75097980bb6371381385b417479c74;p=emacs.git * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514). Don't mishandle (length (format "%%")) and (format "%4000s%%" ""). --- diff --git a/src/ChangeLog b/src/ChangeLog index b89fe55ec30..15281f47438 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-09-15 Paul Eggert + + * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514). + Don't mishandle (length (format "%%")) and (format "%4000s%%" ""). + 2011-09-15 Andreas Schwab * editfns.c (Fformat): Correctly handle text properties on "%%". diff --git a/src/editfns.c b/src/editfns.c index fb9ef7a5b9f..3dd58377ada 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3721,11 +3721,7 @@ usage: (format STRING &rest OBJECTS) */) memset (&discarded[format0 - format_start], 1, format - format0); conversion = *format; if (conversion == '%') - { - format0++; - nchars++; - goto copy_char; - } + goto copy_char; discarded[format - format_start] = 1; format++; @@ -4142,7 +4138,7 @@ usage: (format STRING &rest OBJECTS) */) while (! CHAR_HEAD_P (*format)); convbytes = format - src; - memset (&discarded[format0 + 1 - format_start], 2, convbytes - 1); + memset (&discarded[src + 1 - format_start], 2, convbytes - 1); } else {