summaryrefslogtreecommitdiff
path: root/src/bin/pg_dump/pg_dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/pg_dump/pg_dump.c')
-rw-r--r--src/bin/pg_dump/pg_dump.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 228c0614809..7a06f9b20a8 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -25,7 +25,7 @@
* http://archives.postgresql.org/pgsql-bugs/2010-02/msg00187.php
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.581.2.1 2010/07/14 21:21:16 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.581.2.2 2010/08/13 14:38:12 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -479,19 +479,20 @@ main(int argc, char **argv)
}
}
- if (optind < (argc - 1))
+ /* Get database name from command line */
+ if (optind < argc)
+ dbname = argv[optind++];
+
+ /* Complain if any arguments remain */
+ if (optind < argc)
{
fprintf(stderr, _("%s: too many command-line arguments (first is \"%s\")\n"),
- progname, argv[optind + 1]);
+ progname, argv[optind]);
fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
progname);
exit(1);
}
- /* Get database name from command line */
- if (optind < argc)
- dbname = argv[optind];
-
/* --column-inserts implies --inserts */
if (column_inserts)
dump_inserts = 1;