aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/tui/tui-win.c23
2 files changed, 15 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 21dc3e2..b802641 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-07-06 Tom de Vries <tdevries@suse.de>
+
+ PR tui/26205
+ * tui/tui-win.c (tui_partial_win_by_name): Don't test for NULL name.
+
2020-07-05 Tom de Vries <tdevries@suse.de>
PR build/26187
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 336571f..f906b0d 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -660,21 +660,18 @@ tui_partial_win_by_name (gdb::string_view name)
{
struct tui_win_info *best = nullptr;
- if (name != NULL)
+ for (tui_win_info *item : all_tui_windows ())
{
- for (tui_win_info *item : all_tui_windows ())
- {
- const char *cur_name = item->name ();
+ const char *cur_name = item->name ();
- if (name == cur_name)
- return item;
- if (startswith (cur_name, name))
- {
- if (best != nullptr)
- error (_("Window name \"%*s\" is ambiguous"),
- (int) name.size (), name.data ());
- best = item;
- }
+ if (name == cur_name)
+ return item;
+ if (startswith (cur_name, name))
+ {
+ if (best != nullptr)
+ error (_("Window name \"%*s\" is ambiguous"),
+ (int) name.size (), name.data ());
+ best = item;
}
}