From 7812ba2dea75097980bb6371381385b417479c74 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 15 Sep 2011 11:11:37 -0700 Subject: [PATCH] * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514). Don't mishandle (length (format "%%")) and (format "%4000s%%" ""). --- src/ChangeLog | 5 +++++ src/editfns.c | 8 ++------ 2 files changed, 7 insertions(+), 6 deletions(-) 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 { -- 2.39.2