aboutsummaryrefslogtreecommitdiff
path: root/gdb/language.c
diff options
context:
space:
mode:
authorJohn Gilmore <gnu@cygnus>1991-09-20 23:17:32 +0000
committerJohn Gilmore <gnu@cygnus>1991-09-20 23:17:32 +0000
commit5f3d478e7debb774f55c82dd60e65af242863f83 (patch)
treee563cf4eba0b007ce3fef888117bf49e7de6b5af /gdb/language.c
parent14e2990a5f8cb8dc6eb7dd976a91679e115a72ad (diff)
downloadgdb-5f3d478e7debb774f55c82dd60e65af242863f83.zip
gdb-5f3d478e7debb774f55c82dd60e65af242863f83.tar.gz
gdb-5f3d478e7debb774f55c82dd60e65af242863f83.tar.bz2
* main.c (main): Avoid any output before (gdb) prompt when -q.
* language.c (set_language_command): Handle errors by restoring the language string to its current state (fix from A. Beers).
Diffstat (limited to 'gdb/language.c')
-rw-r--r--gdb/language.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/language.c b/gdb/language.c
index bcb00c7..296a6d5 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -115,6 +115,7 @@ set_language_command (str, from_tty)
{
int i;
enum language flang;
+ char *err_lang;
/* FIXME -- do this from the list, with HELP. */
if (!language || !language[0]) {
@@ -147,7 +148,12 @@ mod or m2 Always parse in Modula-2 syntax\n");
}
}
- error ("Unknown language `%s'.",language);
+ /* Reset the language (esp. the global string "language") to the
+ correct values. */
+ err_lang=savestring(language,strlen(language));
+ make_cleanup (free, err_lang); /* Free it after error */
+ set_language(current_language->la_language);
+ error ("Unknown language `%s'.",err_lang);
}
/* Show command. Display a warning if the type setting does
@@ -1094,7 +1100,7 @@ _initialize_language()
/* Have the above take effect */
- set_language_command (NULL, 0);
+ set_language_command (language, 0);
set_type_command (NULL, 0);
set_range_command (NULL, 0);
}