tidied up ChangeLogs (80 character line width), added reference
[deliverable/binutils-gdb.git] / gdb / utils.c
index c1ed5b73e2038ab1a6ce5e7c403f522fd7d6e1d6..00a060b2c57c9421281277d6e37637d36f4a9d6a 100644 (file)
@@ -54,6 +54,7 @@
 #include "filenames.h"
 #include "symfile.h"
 #include "gdb_obstack.h"
+#include "top.h"
 
 #include "inferior.h"          /* for signed_pointer_to_address */
 
@@ -1141,16 +1142,17 @@ query (const char *ctlstr, ...)
   int ans2;
   int retval;
 
+  /* Automatically answer "yes" if input is not from the user
+     directly, or if the user did not want prompts.  */
+  if (!input_from_terminal_p () || !caution)
+    return 1;
+
   if (deprecated_query_hook)
     {
       va_start (args, ctlstr);
       return deprecated_query_hook (ctlstr, args);
     }
 
-  /* Automatically answer "yes" if input is not from a terminal.  */
-  if (!input_from_terminal_p ())
-    return 1;
-
   while (1)
     {
       wrap_here ("");          /* Flush any buffered output */
@@ -1244,15 +1246,16 @@ defaulted_query (const char *ctlstr, const char defchar, va_list args)
       n_string = "[n]";
     }
 
+  /* Automatically answer the default value if input is not from the user
+     directly, or if the user did not want prompts.  */
+  if (!input_from_terminal_p () || !caution)
+    return def_value;
+
   if (deprecated_query_hook)
     {
       return deprecated_query_hook (ctlstr, args);
     }
 
-  /* Automatically answer default value if input is not from a terminal.  */
-  if (!input_from_terminal_p ())
-    return def_value;
-
   while (1)
     {
       wrap_here ("");          /* Flush any buffered output */
This page took 0.024461 seconds and 4 git commands to generate.