windows-nat: Trim a trailing '\n' from OutputDebugString before echoing it
authorJon Turney <jon.turney@dronecode.org.uk>
Wed, 3 Jun 2015 13:03:50 +0000 (14:03 +0100)
committerJon Turney <jon.turney@dronecode.org.uk>
Wed, 10 Jun 2015 12:24:13 +0000 (13:24 +0100)
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>
gdb/ChangeLog
gdb/windows-nat.c

index c8249550b4e9f72bf431f6a3369c2630378fff2b..bfc6a0ebf270433d2a46295087f25bf6c9d0107a 100644 (file)
@@ -1,3 +1,8 @@
+2015-06-03  Jon Turney  <jon.turney@dronecode.org.uk>
+
+       * windows-nat.c (handle_output_debug_string): Trim trailing '\n'
+       from OutputDebugString.
+
 2015-06-10  Walfred Tedeschi  <walfred.tedeschi@intel.com>
                        Mircea Gherzan  <mircea.gherzan@intel.com>
 
index 701d2c52e80b39b0a9337f53ef4247ccb9bfbb5b..851eb5192d646f5b6a9354d31c4baf44da1a5cc2 100644 (file)
@@ -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
This page took 0.027437 seconds and 4 git commands to generate.