]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/tui] Always check for tui_try_activate result
authorTom de Vries <tdevries@suse.de>
Thu, 19 Mar 2026 09:55:46 +0000 (10:55 +0100)
committerTom de Vries <tdevries@suse.de>
Thu, 19 Mar 2026 09:55:46 +0000 (10:55 +0100)
There are two functions in which we call tui_try_activate, but don't check for
the result.

If it's not a bug, then it's an inconsistency.

Fix this in both functions.

Tested on x86_64-linux.

Reviewed-By: Keith Seitz <keiths@redhat.com>
gdb/tui/tui.c

index 677a8c04b535b677962fc03633886e99aa43f113..b6b6fb7acf515eecc97173be3adb4b7eac027f7c 100644 (file)
@@ -219,9 +219,8 @@ tui_rl_delete_other_windows (int notused1, int notused2)
 static int
 tui_rl_other_window (int count, int key)
 {
-  tui_try_activate ();
-
-  tui_set_win_focus_to (tui_next_win (tui_win_with_focus ()));
+  if (tui_try_activate ())
+    tui_set_win_focus_to (tui_next_win (tui_win_with_focus ()));
 
   return 0;
 }
@@ -271,7 +270,8 @@ tui_rl_command_mode (int count, int key)
 static int
 tui_rl_next_keymap (int notused1, int notused2)
 {
-  tui_try_activate ();
+  if (!tui_try_activate ())
+    return 0;
 
   if (rl_end)
     {