From a741e51424146833ac061a903fb85132505e7ea5 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 17 Sep 2002 17:01:47 +0000 Subject: [PATCH] * c-lang.c (c_emit_char): Don't treat \0 specially unless quoter is "'". --- gdb/ChangeLog | 5 +++++ gdb/c-lang.c | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 40cae6c2962..7329b29661e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-09-17 Tom Tromey + + * c-lang.c (c_emit_char): Don't treat \0 specially unless quoter + is "'". + 2002-09-17 Corinna Vinschen * MAINTAINERS: Remove "non multi-arched" text from h8300. diff --git a/gdb/c-lang.c b/gdb/c-lang.c index 9ee92ad8b8c..9c30483eff7 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; -- 2.30.2