This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix copy_terminal_info thinko.


The whole point of the `if', was to copy the string, not the pointer.
Fixed thusly.

-- 
Pedro Alves

2009-05-24  Pedro Alves  <pedro@codesourcery.com>

	* inflow.c (copy_terminal_info): Deep copy `run_terminal'.

---
 gdb/inflow.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: src/gdb/inflow.c
===================================================================
--- src.orig/gdb/inflow.c	2009-05-20 01:01:46.000000000 +0100
+++ src/gdb/inflow.c	2009-05-20 01:02:02.000000000 +0100
@@ -495,7 +495,8 @@ copy_terminal_info (struct inferior *to,
 {
   *to->terminal_info = *from->terminal_info;
   if (from->terminal_info->run_terminal)
-    to->terminal_info->run_terminal = from->terminal_info->run_terminal;
+    to->terminal_info->run_terminal
+      = xstrdup (from->terminal_info->run_terminal);
 }
 
 void


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]