diff options
| author | Peter Eisentraut <peter_e@gmx.net> | 2000-02-07 23:10:11 +0000 |
|---|---|---|
| committer | Peter Eisentraut <peter_e@gmx.net> | 2000-02-07 23:10:11 +0000 |
| commit | 9ceb5d8a7bfc4a6315f37913afb5f3d6cefa651f (patch) | |
| tree | cfe54170ff754e064955bb00be586a5b26ab7db3 /src/bin/psql/mainloop.c | |
| parent | 4842ef86247a323de9ec25e799d756c320222fe0 (diff) | |
Fixed psql double quoting of SQL ids
Fixed libpq printing functions
Diffstat (limited to 'src/bin/psql/mainloop.c')
| -rw-r--r-- | src/bin/psql/mainloop.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c index cf07b42d31f..325a6b5ed85 100644 --- a/src/bin/psql/mainloop.c +++ b/src/bin/psql/mainloop.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.16 2000/01/24 19:34:17 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.17 2000/02/07 23:10:06 petere Exp $ */ #include <c.h> #include "mainloop.h" @@ -47,10 +47,10 @@ MainLoop(FILE *source) bool xcomment; /* in extended comment */ int paren_level; unsigned int query_start; - int count_eof; + int count_eof = 0; const char *var; bool was_bslash; - unsigned int bslash_count; + unsigned int bslash_count = 0; int i, prevlen, @@ -123,6 +123,8 @@ MainLoop(FILE *source) prompt_status = PROMPT_DOUBLEQUOTE; else if (xcomment) prompt_status = PROMPT_COMMENT; + else if (paren_level) + prompt_status = PROMPT_PAREN; else if (query_buf->len > 0) prompt_status = PROMPT_CONTINUE; else @@ -251,7 +253,7 @@ MainLoop(FILE *source) } /* start of quote */ - else if (line[i] == '\'' || line[i] == '"') + else if (!was_bslash && (line[i] == '\'' || line[i] == '"')) in_quote = line[i]; /* in extended comment? */ |
