aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2003-04-30 12:05:37 +0000
committerRichard M. Stallman2003-04-30 12:05:37 +0000
commit67965a98160853496dff0a8114e791fcea0f54f9 (patch)
tree962d5b3b337f0de37e923ced971f9f41af4524fd /src
parent3de0effb43c7297a8be998e020afc1a2550cf575 (diff)
downloademacs-67965a98160853496dff0a8114e791fcea0f54f9.tar.gz
emacs-67965a98160853496dff0a8114e791fcea0f54f9.zip
(Fformat): Set abort_on_gc during first scan of format.
Reinit FORMAT_START and END before second scan.
Diffstat (limited to 'src')
-rw-r--r--src/editfns.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/editfns.c b/src/editfns.c
index a08864f8678..5bf7e5dff47 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3255,8 +3255,12 @@ usage: (format STRING &rest OBJECTS) */)
3255 /* We may have to change "%S" to "%s". */ 3255 /* We may have to change "%S" to "%s". */
3256 args[0] = Fcopy_sequence (args[0]); 3256 args[0] = Fcopy_sequence (args[0]);
3257 3257
3258 /* GC should never happen here, so abort if it does. */
3259 abort_on_gc++;
3260
3258 /* If we start out planning a unibyte result, 3261 /* If we start out planning a unibyte result,
3259 and later find it has to be multibyte, we jump back to retry. */ 3262 then discover it has to be multibyte, we jump back to retry.
3263 That can only happen from the first large while loop below. */
3260 retry: 3264 retry:
3261 3265
3262 format = SDATA (args[0]); 3266 format = SDATA (args[0]);
@@ -3456,6 +3460,8 @@ usage: (format STRING &rest OBJECTS) */)
3456 total += thissize + 4; 3460 total += thissize + 4;
3457 } 3461 }
3458 3462
3463 abort_on_gc--;
3464
3459 /* Now we can no longer jump to retry. 3465 /* Now we can no longer jump to retry.
3460 TOTAL and LONGEST_FORMAT are known for certain. */ 3466 TOTAL and LONGEST_FORMAT are known for certain. */
3461 3467
@@ -3474,6 +3480,8 @@ usage: (format STRING &rest OBJECTS) */)
3474 3480
3475 /* Scan the format and store result in BUF. */ 3481 /* Scan the format and store result in BUF. */
3476 format = SDATA (args[0]); 3482 format = SDATA (args[0]);
3483 format_start = format;
3484 end = format + SBYTES (args[0]);
3477 maybe_combine_byte = 0; 3485 maybe_combine_byte = 0;
3478 while (format != end) 3486 while (format != end)
3479 { 3487 {