aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-09-17 17:01:47 +0000
committerTom Tromey <tromey@redhat.com>2002-09-17 17:01:47 +0000
commita741e51424146833ac061a903fb85132505e7ea5 (patch)
tree097c49d16a8c82e93304e975dfa5dae13b457462 /gdb/c-lang.c
parent0deec7d673988ca5e9e7088130f980b566fe901b (diff)
downloadgdb-a741e51424146833ac061a903fb85132505e7ea5.zip
gdb-a741e51424146833ac061a903fb85132505e7ea5.tar.gz
gdb-a741e51424146833ac061a903fb85132505e7ea5.tar.bz2
* c-lang.c (c_emit_char): Don't treat \0 specially unless quoter
is "'".
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r--gdb/c-lang.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 9ee92ad..9c30483 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -78,9 +78,12 @@ c_emit_char (register int c, struct ui_file *stream, int quoter)
case '\007':
fputs_filtered ("\\a", stream);
break;
- case '\0':
- fputs_filtered ("\\0", stream);
- break;
+ case '\0':
+ if (quoter == '\'')
+ fputs_filtered ("\\0", stream);
+ else
+ fprintf_filtered (stream, "\\%.3o", (unsigned int) c);
+ break;
default:
fprintf_filtered (stream, "\\%.3o", (unsigned int) c);
break;