Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66541c5

Browse files
committed
Fix pgbench to handle empty lines in script files as documented.
patches contributed by Itagaki Takahiro.
1 parent 2834fb6 commit 66541c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

contrib/pgbench/pgbench.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*
2-
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.52 2006/07/31 05:15:14 ishii Exp $
2+
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.53 2006/08/15 13:05:30 ishii Exp $
33
*
44
* pgbench: a simple benchmark program for PostgreSQL
55
* written by Tatsuo Ishii
66
*
7-
* Copyright (c) 2000-2005 Tatsuo Ishii
7+
* Copyright (c) 2000-2006 Tatsuo Ishii
88
*
99
* Permission to use, copy, modify, and distribute this software and
1010
* its documentation for any purpose and without fee is hereby
@@ -1006,7 +1006,7 @@ process_file(char *filename)
10061006
while (isspace((unsigned char) buf[i]))
10071007
i++;
10081008

1009-
if (strncmp(&buf[i], "\n", 1) != 0 && strncmp(&buf[i], "--", 2) != 0) {
1009+
if (buf[i] != '\0' && strncmp(&buf[i], "--", 2) != 0) {
10101010
commands = process_commands(&buf[i]);
10111011
if (commands == NULL)
10121012
{

0 commit comments

Comments
 (0)