# HG changeset patch # User Kenichi Handa # Date 1049453235 0 # Node ID 4d74ea083bd2e4ab40a4ace6b8be49a931f0f158 # Parent 3892a03097d1ad375ec9bf5731d1030651ac65f9 (Fformat): Use a copy of FORMAT string so that we can destructively change "%S" to "%s". diff -r 3892a03097d1 -r 4d74ea083bd2 src/editfns.c --- a/src/editfns.c Thu Apr 03 23:15:47 2003 +0000 +++ b/src/editfns.c Fri Apr 04 10:47:15 2003 +0000 @@ -3240,6 +3240,8 @@ } 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 @@ 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]))