aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2000-12-03 15:39:38 +0000
committerPeter Eisentraut <peter_e@gmx.net>2000-12-03 15:39:38 +0000
commite7c80220d35a47265001159607503cae2a7ac90c (patch)
treecaec8a0e9035b77842f0bff8fdf18cb71eceee75
parent6969b8fa1194dafdc24e38fccf4acbb32419967e (diff)
downloadpostgresql-e7c80220d35a47265001159607503cae2a7ac90c.tar.gz
postgresql-e7c80220d35a47265001159607503cae2a7ac90c.zip
Fix counting of lines in scripts with 'copy from stdin'.
-rw-r--r--src/bin/psql/copy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c
index 86893da5abd..0f318d3f6e6 100644
--- a/src/bin/psql/copy.c
+++ b/src/bin/psql/copy.c
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.15 2000/04/16 15:46:40 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.16 2000/12/03 15:39:38 petere Exp $
*/
#include "postgres.h"
#include "copy.h"
@@ -403,6 +403,7 @@ handleCopyIn(PGconn *conn, FILE *copystream, const char *prompt)
int bufleft;
int c = 0;
int ret;
+ unsigned int linecount=0;
#ifdef USE_ASSERT_CHECKING
assert(copy_in_state);
@@ -458,8 +459,10 @@ handleCopyIn(PGconn *conn, FILE *copystream, const char *prompt)
}
}
PQputline(conn, "\n");
+ linecount++;
}
ret = !PQendcopy(conn);
copy_in_state = false;
+ pset.lineno += linecount;
return ret;
}