diff options
Diffstat (limited to 'gcc/genoutput.c')
-rw-r--r-- | gcc/genoutput.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/genoutput.c b/gcc/genoutput.c index 7ed98bbbe26..80b73fcb915 100644 --- a/gcc/genoutput.c +++ b/gcc/genoutput.c @@ -366,8 +366,13 @@ output_insn_data () printf (" \""); while (*p) { - if (*p == '\n' && prev != '\\') - printf ("\\n\\\n"); + if (IS_VSPACE (*p) && prev != '\\') + { + /* Preserve two consecutive \n's or \r's, but treat \r\n + as a single newline. */ + if (*p == '\n' && prev != '\r') + printf ("\\n\\\n"); + } else putchar (*p); prev = *p; @@ -694,11 +699,11 @@ process_template (d, template) for (i = 0, cp = &template[1]; *cp; ) { - while (*cp == '\n' || *cp == ' ' || *cp== '\t') + while (ISSPACE (*cp)) cp++; printf (" \""); - while (*cp != '\n' && *cp != '\0') + while (!IS_VSPACE (*cp) && *cp != '\0') { putchar (*cp); cp++; |