]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* toplev.c (output_quoted_string): Write unprintable
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Feb 2002 05:04:39 +0000 (05:04 +0000)
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Feb 2002 05:04:39 +0000 (05:04 +0000)
characters with octal escapes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49891 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/toplev.c

index 55f0d4f58fff0ddc88b4ad66e58dc8d77c2cfcf4..e5bc35e6e3ff26ac9af00214e54066c9f1b85251 100644 (file)
@@ -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
index 4a644d854903d56276e313bea0e4ac87410b7657..4964d2e2c06e1c65b8327dfc5abcd6eb368b14d0 100644 (file)
@@ -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