diff options
| author | Kenichi Handa | 2003-04-04 10:47:26 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2003-04-04 10:47:26 +0000 |
| commit | aa8b70aef52ebe70bf1599b358cfa8a86be6f1bb (patch) | |
| tree | 715626e1a305aad973f945ebe0ec45e352167122 /src | |
| parent | efc13f4638e8f5eff09da00c3e8a58d7a5542c98 (diff) | |
| download | emacs-aa8b70aef52ebe70bf1599b358cfa8a86be6f1bb.tar.gz emacs-aa8b70aef52ebe70bf1599b358cfa8a86be6f1bb.zip | |
(Fformat): Use a copy of FORMAT string so that we can
destructively change "%S" to "%s".
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/editfns.c | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ed6eb184e8c..526998f5d82 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2003-04-04 Kenichi Handa <handa@etlken2> | ||
| 2 | |||
| 3 | * editfns.c (Fformat): Use a copy of FORMAT string so that we can | ||
| 4 | destructively change "%S" to "%s". | ||
| 5 | |||
| 1 | 2003-04-03 Miles Bader <miles@gnu.org> | 6 | 2003-04-03 Miles Bader <miles@gnu.org> |
| 2 | 7 | ||
| 3 | * xfaces.c (choose_face_font): Make sure *NEEDS_OVERSTRIKE is | 8 | * 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) */) | |||
| 3240 | } | 3240 | } |
| 3241 | 3241 | ||
| 3242 | CHECK_STRING (args[0]); | 3242 | CHECK_STRING (args[0]); |
| 3243 | /* We may have to change "%S" to "%s". */ | ||
| 3244 | args[0] = Fcopy_sequence (args[0]); | ||
| 3243 | 3245 | ||
| 3244 | /* If we start out planning a unibyte result, | 3246 | /* If we start out planning a unibyte result, |
| 3245 | and later find it has to be multibyte, we jump back to retry. */ | 3247 | and later find it has to be multibyte, we jump back to retry. */ |
| @@ -3326,6 +3328,11 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3326 | goto retry; | 3328 | goto retry; |
| 3327 | } | 3329 | } |
| 3328 | args[n] = tem; | 3330 | args[n] = tem; |
| 3331 | /* If we restart the loop, we should not come here again | ||
| 3332 | because args[n] is now a string and calling | ||
| 3333 | Fprin1_to_string on it produces superflous double | ||
| 3334 | quotes. So, change "%S" to "%s" now. */ | ||
| 3335 | *format = 's'; | ||
| 3329 | goto string; | 3336 | goto string; |
| 3330 | } | 3337 | } |
| 3331 | else if (SYMBOLP (args[n])) | 3338 | else if (SYMBOLP (args[n])) |