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]))