diff options
author | Tatsuo Ishii <ishii@postgresql.org> | 2005-11-23 12:19:12 +0000 |
---|---|---|
committer | Tatsuo Ishii <ishii@postgresql.org> | 2005-11-23 12:19:12 +0000 |
commit | baa6b22fcb831490c11506b6ec140d75fe8fff81 (patch) | |
tree | 17491cf3dba7e5274c98a2d4fb365778cb811773 | |
parent | aac96b899490c4d23204660b3b6d47e3dd4d918c (diff) | |
download | postgresql-baa6b22fcb831490c11506b6ec140d75fe8fff81.tar.gz postgresql-baa6b22fcb831490c11506b6ec140d75fe8fff81.zip |
Having blank lines in -f scripts was causing silent failures.
per David Fetter
-rw-r--r-- | contrib/pgbench/pgbench.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c index 70081be5858..a5060204ce8 100644 --- a/contrib/pgbench/pgbench.c +++ b/contrib/pgbench/pgbench.c @@ -1,5 +1,5 @@ /* - * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.47 2005/11/23 04:23:28 momjian Exp $ + * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.48 2005/11/23 12:19:12 ishii Exp $ * * pgbench: a simple benchmark program for PostgreSQL * written by Tatsuo Ishii @@ -886,11 +886,17 @@ process_file(char *filename) { Command *commands; - commands = process_commands(buf); - if (commands == NULL) - { - fclose(fd); - return false; + + if (strncmp(buf, "\n", 1) != 0) { + commands = process_commands(buf); + if (commands == NULL) + { + fclose(fd); + return false; + } + } else { + lineno++; + continue; } my_commands[lineno] = commands; |