aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/toplev.c11
2 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 55f0d4f..e5bc35e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-02-19 Zack Weinberg <zack@codesourcery.com>
+
+ * toplev.c (output_quoted_string): Write unprintable
+ characters with octal escapes.
+
2002-02-19 David Edelsohn <edelsohn@gnu.org>
* config/rs6000/rs6000.h (CONDITIONAL_REGISTER_USAGE): Set
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