From 1307c9471f4d06c7a6c1534a6d6217ac1a208b95 Mon Sep 17 00:00:00 2001 From: handa Date: Thu, 22 Sep 2005 07:28:21 +0000 Subject: [PATCH] (mdebug_dump_mtext): Escape '"' and '\\' by '\\'. --- src/mtext.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mtext.c b/src/mtext.c index 6340339..975a4b4 100644 --- a/src/mtext.c +++ b/src/mtext.c @@ -3606,7 +3606,10 @@ mdebug_dump_mtext (MText *mt, int indent, int fullp) for (i = 0; i < mt->nchars; i++) { int c = mtext_ref_char (mt, i); - if (c >= ' ' && c < 127) + + if (c == '"' || c == '\\') + fprintf (stderr, "\\%c", c); + else if (c >= ' ' && c < 127) fprintf (stderr, "%c", c); else fprintf (stderr, "\\x%02X", c); @@ -3626,7 +3629,9 @@ mdebug_dump_mtext (MText *mt, int indent, int fullp) int len; int c = STRING_CHAR_AND_BYTES (p, len); - if (c >= ' ' && c < 127 && c != '\\' && c != '\"') + if (c == '"' || c == '\\') + fprintf (stderr, "\\%c", c); + else if (c >= ' ' && c < 127) fputc (c, stderr); else fprintf (stderr, "\\x%X", c); -- 1.7.10.4