From 4e93ea6e67fd7260ef842b9eeb20f071648c056e Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 28 Jun 2021 16:32:00 -0400 Subject: gdb: make inferior::m_terminal an std::string Same idea as the previous patch, but for m_terminal. Change-Id: If9367d5db8c976a4336680adca4ea5bc31ab64d2 --- gdb/infcmd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gdb/infcmd.c') diff --git a/gdb/infcmd.c b/gdb/infcmd.c index c027176..c183b60 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -115,13 +115,11 @@ show_inferior_tty_command (struct ui_file *file, int from_tty, { /* Note that we ignore the passed-in value in favor of computing it directly. */ - const char *inferior_tty = current_inferior ()->tty (); + const std::string &inferior_tty = current_inferior ()->tty (); - if (inferior_tty == nullptr) - inferior_tty = ""; fprintf_filtered (gdb_stdout, _("Terminal for future runs of program being debugged " - "is \"%s\".\n"), inferior_tty); + "is \"%s\".\n"), inferior_tty.c_str ()); } void -- cgit v1.1