From bead35d4c226e1a2be24d24a30ade43675f181b7 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Thu, 20 May 2010 16:42:46 -0400 Subject: [PATCH] Fix pg_auth quoting. Postgres does not use \ there, only "" -> " --- src/loader.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/loader.c b/src/loader.c index 15e5ade..72be2fe 100644 --- a/src/loader.c +++ b/src/loader.c @@ -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; } -- 2.40.0