aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuo Ishii <ishii@postgresql.org>2006-08-15 13:05:30 +0000
committerTatsuo Ishii <ishii@postgresql.org>2006-08-15 13:05:30 +0000
commit66541c5aa51bf6128afa8ebb4bb90959b596705f (patch)
treeb54c84d5b287fa3b181f8149934a361cd1ac70e6
parent2834fb6a834342e5298609e371183521b395675e (diff)
downloadpostgresql-66541c5aa51bf6128afa8ebb4bb90959b596705f.tar.gz
postgresql-66541c5aa51bf6128afa8ebb4bb90959b596705f.zip
Fix pgbench to handle empty lines in script files as documented.
patches contributed by Itagaki Takahiro.
-rw-r--r--contrib/pgbench/pgbench.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index 206b3a66ae2..416f3c2e324 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -1,10 +1,10 @@
/*
- * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.52 2006/07/31 05:15:14 ishii Exp $
+ * $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.53 2006/08/15 13:05:30 ishii Exp $
*
* pgbench: a simple benchmark program for PostgreSQL
* written by Tatsuo Ishii
*
- * Copyright (c) 2000-2005 Tatsuo Ishii
+ * Copyright (c) 2000-2006 Tatsuo Ishii
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
@@ -1006,7 +1006,7 @@ process_file(char *filename)
while (isspace((unsigned char) buf[i]))
i++;
- if (strncmp(&buf[i], "\n", 1) != 0 && strncmp(&buf[i], "--", 2) != 0) {
+ if (buf[i] != '\0' && strncmp(&buf[i], "--", 2) != 0) {
commands = process_commands(&buf[i]);
if (commands == NULL)
{