From: Tom Tromey Date: Tue, 17 Sep 2002 17:01:47 +0000 (+0000) Subject: * c-lang.c (c_emit_char): Don't treat \0 specially unless quoter X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a741e51424146833ac061a903fb85132505e7ea5;p=binutils-gdb.git * c-lang.c (c_emit_char): Don't treat \0 specially unless quoter is "'". --- 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;