aboutsummaryrefslogtreecommitdiff
path: root/gdb/windows-nat.c
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2015-06-03 14:03:50 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2015-06-10 13:24:13 +0100
commit040ea00bb02018cbe21ba732f68134ac91f370d2 (patch)
tree59c352bb18dccb27255af687051794a865784055 /gdb/windows-nat.c
parent7d73c23c4d8cf727528ac5a34a787e44a30d98cc (diff)
downloadgdb-040ea00bb02018cbe21ba732f68134ac91f370d2.zip
gdb-040ea00bb02018cbe21ba732f68134ac91f370d2.tar.gz
gdb-040ea00bb02018cbe21ba732f68134ac91f370d2.tar.bz2
windows-nat: Trim a trailing '\n' from OutputDebugString before echoing it
For cosmetic purposes, trim a trailing '\n' from OutputDebugString before echoing it, as warning() will add a '\n', anyhow. gdb/ChangeLog: 2015-06-03 Jon Turney <jon.turney@dronecode.org.uk> * windows-nat.c (handle_output_debug_string): Trim trailing '\n' from OutputDebugString. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r--gdb/windows-nat.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 701d2c5..851eb51 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -818,7 +818,13 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
#ifdef __CYGWIN__
if (!startswith (s, "cYg"))
#endif
- warning (("%s"), s);
+ {
+ char *p = strchr (s, '\0');
+
+ if (p > s && *--p == '\n')
+ *p = '\0';
+ warning (("%s"), s);
+ }
}
#ifdef __COPY_CONTEXT_SIZE
else