From 040ea00bb02018cbe21ba732f68134ac91f370d2 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Wed, 3 Jun 2015 14:03:50 +0100 Subject: 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 * windows-nat.c (handle_output_debug_string): Trim trailing '\n' from OutputDebugString. Signed-off-by: Jon Turney --- gdb/windows-nat.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gdb/windows-nat.c') 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 -- cgit v1.1