changeset 50430:4d74ea083bd2

(Fformat): Use a copy of FORMAT string so that we can destructively change "%S" to "%s".
author Kenichi Handa <handa@m17n.org>
date Fri, 04 Apr 2003 10:47:15 +0000
parents 3892a03097d1
children 35165c59c478
files src/editfns.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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]))