(make_gap): Keep input blocked till after we set BEG_ADDR.
authorRichard M. Stallman <rms@gnu.org>
Fri, 7 Oct 1994 17:40:50 +0000 (17:40 +0000)
committerRichard M. Stallman <rms@gnu.org>
Fri, 7 Oct 1994 17:40:50 +0000 (17:40 +0000)
src/insdel.c

index 969f70d..833d006 100644 (file)
@@ -271,11 +271,16 @@ make_gap (increment)
 
   BLOCK_INPUT;
   result = BUFFER_REALLOC (BEG_ADDR, (Z - BEG + GAP_SIZE + increment));
-  UNBLOCK_INPUT;
 
   if (result == 0)
-    memory_full ();
+    {
+      UNBLOCK_INPUT;
+      memory_full ();
+    }
+
+  /* We can't unblock until the new address is properly stored.  */
   BEG_ADDR = result;
+  UNBLOCK_INPUT;
 
   /* Prevent quitting in move_gap.  */
   tem = Vinhibit_quit;