From: Bruce Momjian Date: Fri, 19 Sep 1997 03:42:39 +0000 (+0000) Subject: Fix \e and \p after query. X-Git-Tag: REL6_2~141 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34ec62058a56ca7867966dbeee25b8df91687b43;p=postgresql Fix \e and \p after query. --- diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index 5a75651ad8..d137077280 100644 --- a/src/bin/psql/psql.c +++ b/src/bin/psql/psql.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.96 1997/09/18 20:22:42 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.97 1997/09/19 03:42:39 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1776,6 +1776,30 @@ MainLoop(PsqlSettings *pset, FILE *source) for (i = 0; i < len; i++) { + if (line[i] == '\\') + { + char hold_char = line[i]; + + line[i] = '\0'; + if (query_start[0] != '\0') + { + if (query[0] != '\0') + { + strcat(query, "\n"); + strcat(query, query_start); + } + else + { + strcpy(query, query_start); + }; + } + line[i] = hold_char; + query_start = line + i; + break; /* handle command */ + + /* start an extended comment? */ + } + if (querySent && !isspace(line[i])) { query[0] = '\0'; @@ -1800,29 +1824,6 @@ MainLoop(PsqlSettings *pset, FILE *source) /* possible backslash command? */ } - else if (line[i] == '\\') - { - char hold_char = line[i]; - - line[i] = '\0'; - if (query_start[0] != '\0') - { - if (query[0] != '\0') - { - strcat(query, "\n"); - strcat(query, query_start); - } - else - { - strcpy(query, query_start); - }; - } - line[i] = hold_char; - query_start = line + i; - break; /* handle command */ - - /* start an extended comment? */ - } else if (line[i] == '/' && line[i + 1] == '*') { xcomment = line + i;