From: handa Date: Thu, 22 Sep 2005 07:28:21 +0000 (+0000) Subject: (mdebug_dump_mtext): Escape '"' and '\\' by '\\'. X-Git-Tag: REL-1-3-0~148 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1307c9471f4d06c7a6c1534a6d6217ac1a208b95;p=m17n%2Fm17n-lib.git (mdebug_dump_mtext): Escape '"' and '\\' by '\\'. --- 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);