[60/61] Fix an error in parse_scrolling_args

Message ID 20190704170311.15982-61-tom@tromey.com
State New
Headers show
Series
  • More TUI refactorings
Related show

Commit Message

Tom Tromey July 4, 2019, 5:03 p.m.
parse_scrolling_args combines two errors into one message, which also
happens to end with a newline.  This separates the errors and fixes
the message.

2019-07-04  Tom Tromey  <tom@tromey.com>

	* tui/tui-win.c (parse_scrolling_args): Throw separate errors.
---
 gdb/ChangeLog     | 4 ++++
 gdb/tui/tui-win.c | 8 ++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

-- 
2.17.2

Patch

diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 1e02c42dbd1..db4dc1088a6 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -1391,10 +1391,10 @@  parse_scrolling_args (const char *arg,
 	  
 	  *win_to_scroll = tui_partial_win_by_name (wname);
 
-	  if (*win_to_scroll == NULL
-	      || !(*win_to_scroll)->is_visible)
-	    error (_("Invalid window specified. \n\
-The window name specified must be valid and visible.\n"));
+	  if (*win_to_scroll == NULL)
+	    error (_("Unrecognized window `%s'"), wname);
+	  if (!(*win_to_scroll)->is_visible)
+	    error (_("Window is not visible"));
 	  else if (*win_to_scroll == TUI_CMD_WIN)
 	    *win_to_scroll = tui_source_windows ()[0];
 	}