]> granicus.if.org Git - postgresql/commitdiff
Also escape double quotes for ECPG's #line statement.
authorMichael Meskes <meskes@postgresql.org>
Sat, 6 Jul 2013 20:08:53 +0000 (22:08 +0200)
committerMichael Meskes <meskes@postgresql.org>
Sat, 6 Jul 2013 20:11:28 +0000 (22:11 +0200)
src/interfaces/ecpg/preproc/output.c

index 616e8f040086684e97746bf6b0aa71873ae835fb..007c07c0342073aec68e8d7188616d91e69be4f9 100644 (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++;
                }