|
|
@ -3,7 +3,7 @@ |
|
|
|
* |
|
|
|
* |
|
|
|
* Copyright 2000 by PostgreSQL Global Development Group |
|
|
|
* Copyright 2000 by PostgreSQL Global Development Group |
|
|
|
* |
|
|
|
* |
|
|
|
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.40 2000/11/26 11:09:32 petere Exp $ |
|
|
|
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.41 2000/11/27 02:20:36 tgl Exp $ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
#include "postgres.h" |
|
|
|
#include "postgres.h" |
|
|
|
#include "command.h" |
|
|
|
#include "command.h" |
|
|
@ -1236,7 +1236,8 @@ do_connect(const char *new_dbname, const char *new_user) |
|
|
|
NULL, NULL, dbparam, userparam, pwparam); |
|
|
|
NULL, NULL, dbparam, userparam, pwparam); |
|
|
|
|
|
|
|
|
|
|
|
if (PQstatus(pset.db) == CONNECTION_BAD && |
|
|
|
if (PQstatus(pset.db) == CONNECTION_BAD && |
|
|
|
strcmp(PQerrorMessage(pset.db), "fe_sendauth: no password supplied\n") == 0) |
|
|
|
strcmp(PQerrorMessage(pset.db), "fe_sendauth: no password supplied\n") == 0 && |
|
|
|
|
|
|
|
!feof(stdin)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
PQfinish(pset.db); |
|
|
|
PQfinish(pset.db); |
|
|
|
need_pass = true; |
|
|
|
need_pass = true; |
|
|
@ -1491,7 +1492,7 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf) |
|
|
|
char line[1024]; |
|
|
|
char line[1024]; |
|
|
|
|
|
|
|
|
|
|
|
resetPQExpBuffer(query_buf); |
|
|
|
resetPQExpBuffer(query_buf); |
|
|
|
while (fgets(line, 1024, stream)) |
|
|
|
while (fgets(line, sizeof(line), stream) != NULL) |
|
|
|
appendPQExpBufferStr(query_buf, line); |
|
|
|
appendPQExpBufferStr(query_buf, line); |
|
|
|
|
|
|
|
|
|
|
|
if (ferror(stream)) |
|
|
|
if (ferror(stream)) |
|
|
|