diff options
author | Tom Tromey <tromey@redhat.com> | 2002-09-17 17:01:47 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2002-09-17 17:01:47 +0000 |
commit | a741e51424146833ac061a903fb85132505e7ea5 (patch) | |
tree | 097c49d16a8c82e93304e975dfa5dae13b457462 | |
parent | 0deec7d673988ca5e9e7088130f980b566fe901b (diff) | |
download | gdb-a741e51424146833ac061a903fb85132505e7ea5.zip gdb-a741e51424146833ac061a903fb85132505e7ea5.tar.gz gdb-a741e51424146833ac061a903fb85132505e7ea5.tar.bz2 |
* c-lang.c (c_emit_char): Don't treat \0 specially unless quoter
is "'".
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/c-lang.c | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 40cae6c..7329b29 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-09-17 Tom Tromey <tromey@redhat.com> + + * c-lang.c (c_emit_char): Don't treat \0 specially unless quoter + is "'". + 2002-09-17 Corinna Vinschen <vinschen@redhat.com> * MAINTAINERS: Remove "non multi-arched" text from h8300. 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; |