Skip to content

Commit baa6b22

Browse files
committed
Having blank lines in -f scripts was causing silent failures.
per David Fetter
1 parent aac96b8 commit baa6b22

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

contrib/pgbench/pgbench.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.47 2005/11/23 04:23:28 momjian Exp $
2+
* $PostgreSQL: pgsql/contrib/pgbench/pgbench.c,v 1.48 2005/11/23 12:19:12 ishii Exp $
33
*
44
* pgbench: a simple benchmark program for PostgreSQL
55
* written by Tatsuo Ishii
@@ -886,11 +886,17 @@ process_file(char *filename)
886886
{
887887
Command *commands;
888888

889-
commands = process_commands(buf);
890-
if (commands == NULL)
891-
{
892-
fclose(fd);
893-
return false;
889+
890+
if (strncmp(buf, "\n", 1) != 0) {
891+
commands = process_commands(buf);
892+
if (commands == NULL)
893+
{
894+
fclose(fd);
895+
return false;
896+
}
897+
} else {
898+
lineno++;
899+
continue;
894900
}
895901

896902
my_commands[lineno] = commands;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy