diff options
author | John Gilmore <gnu@cygnus> | 1993-02-18 12:18:23 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1993-02-18 12:18:23 +0000 |
commit | c5c00171a20baef8541b9d61df233546e6e4d3bf (patch) | |
tree | 753425238bcd478065141626bef72771df9d964b /gdb/c-lang.c | |
parent | eece984d9936b0854ff7d0d5e01f618ff9d843f7 (diff) | |
download | gdb-c5c00171a20baef8541b9d61df233546e6e4d3bf.zip gdb-c5c00171a20baef8541b9d61df233546e6e4d3bf.tar.gz gdb-c5c00171a20baef8541b9d61df233546e6e4d3bf.tar.bz2 |
* c-lang.c (c_printstr): If a C string ends in a null, don't
print the null.
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r-- | gdb/c-lang.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c index df88210..bfa03d0 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -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) && string[length-1] == '\0') + length--; + if (length == 0) { fputs_filtered ("\"\"", stdout); |