gdb: make inferior::terminal a unique ptr
[deliverable/binutils-gdb.git] / gdb / infcmd.c
index 891da91c806e42612ded631e7063b942e8056d54..48d6a91c0c2499ae7fcd4c0aef8f02d6c4da6d34 100644 (file)
@@ -108,10 +108,8 @@ int stopped_by_random_signal;
 void 
 set_inferior_io_terminal (const char *terminal_name)
 {
-  xfree (current_inferior ()->terminal);
-
   if (terminal_name != NULL && *terminal_name != '\0')
-    current_inferior ()->terminal = xstrdup (terminal_name);
+    current_inferior ()->terminal.reset (xstrdup (terminal_name));
   else
     current_inferior ()->terminal = NULL;
 }
@@ -119,7 +117,7 @@ set_inferior_io_terminal (const char *terminal_name)
 const char *
 get_inferior_io_terminal (void)
 {
-  return current_inferior ()->terminal;
+  return current_inferior ()->terminal.get ();
 }
 
 static void
@@ -3052,7 +3050,7 @@ is restored."),
                                     show_inferior_tty_command,
                                     &setlist, &showlist);
   cmd_name = "inferior-tty";
-  c = lookup_cmd (&cmd_name, setlist, "", -1, 1);
+  c = lookup_cmd (&cmd_name, setlist, "", NULL, -1, 1);
   gdb_assert (c != NULL);
   add_alias_cmd ("tty", c, class_run, 0, &cmdlist);
 
@@ -3065,7 +3063,7 @@ Follow this command with any number of args, to be passed to the program."),
                                   set_args_command,
                                   show_args_command,
                                   &setlist, &showlist);
-  c = lookup_cmd (&cmd_name, setlist, "", -1, 1);
+  c = lookup_cmd (&cmd_name, setlist, "", NULL, -1, 1);
   gdb_assert (c != NULL);
   set_cmd_completer (c, filename_completer);
 
@@ -3084,7 +3082,7 @@ working directory."),
                                   set_cwd_command,
                                   show_cwd_command,
                                   &setlist, &showlist);
-  c = lookup_cmd (&cmd_name, setlist, "", -1, 1);
+  c = lookup_cmd (&cmd_name, setlist, "", NULL, -1, 1);
   gdb_assert (c != NULL);
   set_cmd_completer (c, filename_completer);
 
This page took 0.0261 seconds and 4 git commands to generate.