This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Fix copy_terminal_info thinko.
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Sun, 24 May 2009 19:17:53 +0100
- Subject: 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