+ if (command_loop_hook == NULL)
+ command_loop ();
+ else
+ command_loop_hook ();
+ /* FIXME: cagney/1999-11-05: A correct command_loop() implementaton
+ would clean things up (restoring the cleanup chain) to the state
+ they were just prior to the call. Technically, this means that
+ the do_cleanups() below is redundant. Unfortunately, many FUNCs
+ are not that well behaved. do_cleanups should either be replaced
+ with a do_cleanups call (to cover the problem) or an assertion
+ check to detect bad FUNCs code. */
+ do_cleanups (ALL_CLEANUPS);
+ /* If the command_loop returned, normally (rather than threw an
+ error) we try to quit. If the quit is aborted, catch_errors()
+ which called this catch the signal and restart the command
+ loop. */
+ quit_command (NULL, instream == stdin);
+ return 1;
+}
+
+struct captured_main_args
+ {
+ int argc;
+ char **argv;
+ };
+
+static int
+captured_main (void *data)
+{
+ struct captured_main_args *context = data;
+ int argc = context->argc;
+ char **argv = context->argv;