From 042cdf7164c636e6d8ea671c2817f59c4914f3db Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Wed, 20 Feb 2002 05:04:39 +0000 Subject: toplev.c (output_quoted_string): Write unprintable characters with octal escapes. * toplev.c (output_quoted_string): Write unprintable characters with octal escapes. From-SVN: r49891 --- gcc/toplev.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gcc/toplev.c') diff --git a/gcc/toplev.c b/gcc/toplev.c index 4a644d8..4964d2e 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1762,9 +1762,14 @@ output_quoted_string (asm_file, string) putc ('\"', asm_file); while ((c = *string++) != 0) { - if (c == '\"' || c == '\\') - putc ('\\', asm_file); - putc (c, asm_file); + if (ISPRINT (c)) + { + if (c == '\"' || c == '\\') + putc ('\\', asm_file); + putc (c, asm_file); + } + else + fprintf (asm_file, "\\%03o", c); } putc ('\"', asm_file); #endif -- cgit v1.1