mirror of
https://github.com/postgres/postgres.git
synced 2025-06-23 14:01:44 +03:00
Here's some changes I made last night to psql's common.c (as found in
7.3.2). It removes some code duplication and #ifdeffing, and some unstructured ugliness such as tacky breaks and an unneeded continue. Breaks up a large function into smaller functions and reduces required nesting levels, and kills a variable or two. Jeroen T. Vermeulen
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright 2000 by PostgreSQL Global Development Group
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.28 2002/10/19 00:22:14 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.29 2003/03/20 06:00:12 momjian Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
#include "copy.h"
|
||||
@ -446,8 +446,6 @@ handleCopyOut(PGconn *conn, FILE *copystream)
|
||||
char copybuf[COPYBUFSIZ];
|
||||
int ret;
|
||||
|
||||
assert(cancelConn);
|
||||
|
||||
while (!copydone)
|
||||
{
|
||||
ret = PQgetline(conn, copybuf, COPYBUFSIZ);
|
||||
@ -476,7 +474,7 @@ handleCopyOut(PGconn *conn, FILE *copystream)
|
||||
}
|
||||
fflush(copystream);
|
||||
ret = !PQendcopy(conn);
|
||||
cancelConn = NULL;
|
||||
ResetCancelConn();
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user