Also escape double quotes for ECPG's #line statement.

This commit is contained in:
Michael Meskes 2013-07-06 22:08:53 +02:00
parent 0cd787802f
commit 43c3aab123

View File

@ -95,7 +95,7 @@ hashline_number(void)
#endif
)
{
/* "* 2" here is for escaping \s below */
/* "* 2" here is for escaping '\' and '"' below */
char *line = mm_alloc(strlen("\n#line %d \"%s\"\n") + sizeof(int) * CHAR_BIT * 10 / 3 + strlen(input_filename) * 2);
char *src,
*dest;
@ -105,7 +105,7 @@ hashline_number(void)
dest = line + strlen(line);
while (*src)
{
if (*src == '\\')
if (*src == '\\' || *src == '"')
*dest++ = '\\';
*dest++ = *src++;
}