Commit 43c3aab1 authored by Michael Meskes's avatar Michael Meskes

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

parent 0cd78780
...@@ -95,7 +95,7 @@ hashline_number(void) ...@@ -95,7 +95,7 @@ hashline_number(void)
#endif #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 *line = mm_alloc(strlen("\n#line %d \"%s\"\n") + sizeof(int) * CHAR_BIT * 10 / 3 + strlen(input_filename) * 2);
char *src, char *src,
*dest; *dest;
...@@ -105,7 +105,7 @@ hashline_number(void) ...@@ -105,7 +105,7 @@ hashline_number(void)
dest = line + strlen(line); dest = line + strlen(line);
while (*src) while (*src)
{ {
if (*src == '\\') if (*src == '\\' || *src == '"')
*dest++ = '\\'; *dest++ = '\\';
*dest++ = *src++; *dest++ = *src++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment