aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@codesourcery.com>2002-02-20 05:04:39 +0000
committerZack Weinberg <zack@gcc.gnu.org>2002-02-20 05:04:39 +0000
commit042cdf7164c636e6d8ea671c2817f59c4914f3db (patch)
tree4dfc4e625d4e79c5c769b2b5292d37925441c04f /gcc/toplev.c
parentc1f1154803699211270deea00b9f23aefe0e4cb5 (diff)
downloadgcc-042cdf7164c636e6d8ea671c2817f59c4914f3db.zip
gcc-042cdf7164c636e6d8ea671c2817f59c4914f3db.tar.gz
gcc-042cdf7164c636e6d8ea671c2817f59c4914f3db.tar.bz2
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
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c11
1 files changed, 8 insertions, 3 deletions
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