mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Also escape double quotes for ECPG's #line statement.
This commit is contained in:
parent
0cd787802f
commit
43c3aab123
@ -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++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user