aboutsummaryrefslogtreecommitdiff
path: root/gdb/valprint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2022-01-26 18:07:18 -0700
committerTom Tromey <tom@tromey.com>2022-10-10 10:43:33 -0600
commit1be8435c74de6738aec7ed623b59e381fa9bb644 (patch)
tree0a2e2d275bf9cc7b63bc5ece21ecfb828a78bc64 /gdb/valprint.c
parent79aafec96b237165e66f14ba963214fb709af847 (diff)
downloadgdb-1be8435c74de6738aec7ed623b59e381fa9bb644.zip
gdb-1be8435c74de6738aec7ed623b59e381fa9bb644.tar.gz
gdb-1be8435c74de6738aec7ed623b59e381fa9bb644.tar.bz2
Fix latent quote char bug in generic_printstr
generic_printstr prints an empty string like: fputs_filtered ("\"\"", stream); However, this seems wrong to me if the quote character is something other than double quote. This patch fixes this latent bug. Thanks to Andrew for the test case. Co-authored-by: Andrew Burgess <aburgess@redhat.com>
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r--gdb/valprint.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c
index 91a5941..395c6e9 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -2516,7 +2516,7 @@ generic_printstr (struct ui_file *stream, struct type *type,
if (length == 0)
{
- gdb_puts ("\"\"", stream);
+ gdb_printf (stream, "%c%c", quote_char, quote_char);
return;
}