(output_quoted_string): New function.

(output_file_directive): Quote special characters in file names.

From-SVN: r5499
This commit is contained in:
Paul Eggert 1993-09-28 00:23:58 +00:00
parent 6767265cea
commit 7dce5088a7
1 changed files with 21 additions and 1 deletions

View File

@ -1498,6 +1498,24 @@ strip_off_ending (name, len)
name[len - 4] = 0;
}
/* Output a quoted string. */
void
output_quoted_string (asm_file, string)
FILE *asm_file;
char *string;
{
char c;
putc ('\"', asm_file);
while ((c = *string++) != 0)
{
if (c == '\"' || c == '\\')
putc ('\\', asm_file);
putc (c, asm_file);
}
putc ('\"', asm_file);
}
/* Output a file name in the form wanted by System V. */
void
@ -1522,7 +1540,9 @@ output_file_directive (asm_file, input_name)
#ifdef ASM_OUTPUT_SOURCE_FILENAME
ASM_OUTPUT_SOURCE_FILENAME (asm_file, na);
#else
fprintf (asm_file, "\t.file\t\"%s\"\n", na);
fprintf (asm_file, "\t.file\t");
output_quoted_string (asm_file, na);
fputc ('\n', asm_file);
#endif
#endif
}