use remote-utils facilities for baud_rate
[deliverable/binutils-gdb.git] / gdb / c-lang.c
index df882100f1a3df460cac4ced0b738a9325feeeb7..b96dc1ef950739183f67683cfc983a52bc94fd90 100644 (file)
@@ -1,5 +1,5 @@
 /* C language support routines for GDB, the GNU debugger.
-   Copyright 1992 Free Software Foundation, Inc.
+   Copyright 1992, 1993 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -108,6 +108,12 @@ c_printstr (stream, string, length, force_ellipses)
   extern int repeat_count_threshold;
   extern int print_max;
 
+  /* If the string was not truncated due to `set print elements', and
+     the last byte of it is a null, we don't print that, in traditional C
+     style.  */
+  if ((!force_ellipses) && length > 0 && string[length-1] == '\0')
+    length--;
+
   if (length == 0)
     {
       fputs_filtered ("\"\"", stdout);
This page took 0.023971 seconds and 4 git commands to generate.