]> granicus.if.org Git - pgbouncer/commitdiff
Fix pg_auth quoting.
authorMarko Kreen <markokr@gmail.com>
Thu, 20 May 2010 20:42:46 +0000 (16:42 -0400)
committerMarko Kreen <markokr@gmail.com>
Thu, 20 May 2010 20:42:46 +0000 (16:42 -0400)
Postgres does not use \ there, only "" -> "

src/loader.c

index 15e5ade6004f0d57ac3a3b2b89552ba85acf2c60..72be2fec9f532be157be1feb1cebef19074af630 100644 (file)
@@ -376,8 +376,9 @@ void parse_database(char *name, char *connstr)
 static char *find_quote(char *p)
 {
 loop:
-       while (*p && *p != '\\' && *p != '"') p++;
-       if (*p == '\\' && p[1]) {
+       while (*p && *p != '"')
+               p++;
+       if (p[0] == '"' && p[1] == '"') {
                p += 2;
                goto loop;
        }
@@ -390,10 +391,9 @@ static void copy_quoted(char *dst, const char *src, int len)
 {
        char *end = dst + len - 1;
        while (*src && dst < end) {
-               if (*src != '\\')
-                       *dst++ = *src++;
-               else
+               if (*src == '"')
                        src++;
+               *dst++ = *src++;
        }
        *dst = 0;
 }