Commit 66541c5a authored by Tatsuo Ishii's avatar Tatsuo Ishii

Fix pgbench to handle empty lines in script files as documented.

patches contributed by Itagaki Takahiro.
parent 2834fb6a
/* /*
* $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 * pgbench: a simple benchmark program for PostgreSQL
* written by Tatsuo Ishii * 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 * Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby * its documentation for any purpose and without fee is hereby
...@@ -1006,7 +1006,7 @@ process_file(char *filename) ...@@ -1006,7 +1006,7 @@ process_file(char *filename)
while (isspace((unsigned char) buf[i])) while (isspace((unsigned char) buf[i]))
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]); commands = process_commands(&buf[i]);
if (commands == NULL) if (commands == NULL)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment