characters, and only print TREE_STRING_LENGTH chars.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56994
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-09-09 Per Bothner <per@bothner.com>
+
+ * print-tree.c (print_node): In a STRING_CST, escape non-ascii
+ characters, and only print TREE_STRING_LENGTH chars.
+
2002-09-09 Steve Ellcey <sje@cup.hp.com>
* config/ia64/hpux.h (TARGET_HPUX_LD): New, define true.
break;
case STRING_CST:
- fprintf (file, " \"%s\"", TREE_STRING_POINTER (node));
+ {
+ const char *p = TREE_STRING_POINTER (node);
+ int i = TREE_STRING_LENGTH (node);
+ fputs (" \"", file);
+ while (--i >= 0)
+ {
+ char ch = *p++;
+ if (ch >= ' ' && ch < 127)
+ putc (ch, file);
+ else
+ fprintf(file, "\\%03o", ch & 0xFF);
+ }
+ fputc ('\"', file);
+ }
/* Print the chain at second level. */
if (indent == 4)
print_node (file, "chain", TREE_CHAIN (node), indent + 4);