From aa8b70aef52ebe70bf1599b358cfa8a86be6f1bb Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 4 Apr 2003 10:47:26 +0000 Subject: [PATCH] (Fformat): Use a copy of FORMAT string so that we can destructively change "%S" to "%s". --- src/ChangeLog | 5 +++++ src/editfns.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index ed6eb184e8c..526998f5d82 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-04-04 Kenichi Handa + + * editfns.c (Fformat): Use a copy of FORMAT string so that we can + destructively change "%S" to "%s". + 2003-04-03 Miles Bader * xfaces.c (choose_face_font): Make sure *NEEDS_OVERSTRIKE is diff --git a/src/editfns.c b/src/editfns.c index 0c012514f93..360e067a298 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3240,6 +3240,8 @@ usage: (format STRING &rest OBJECTS) */) } CHECK_STRING (args[0]); + /* We may have to change "%S" to "%s". */ + args[0] = Fcopy_sequence (args[0]); /* If we start out planning a unibyte result, and later find it has to be multibyte, we jump back to retry. */ @@ -3326,6 +3328,11 @@ usage: (format STRING &rest OBJECTS) */) goto retry; } args[n] = tem; + /* If we restart the loop, we should not come here again + because args[n] is now a string and calling + Fprin1_to_string on it produces superflous double + quotes. So, change "%S" to "%s" now. */ + *format = 's'; goto string; } else if (SYMBOLP (args[n])) -- 2.39.2