summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorTom Lane2002-01-10 01:11:45 +0000
committerTom Lane2002-01-10 01:11:45 +0000
commit92a2598f9744881a99f44f119bb0eb6ccde36c6c (patch)
treed7ca45d6c4a48156cff396d9889637e984ad64ed /contrib
parent4d72af6cb31baa8d92bc86955ea7e5c4bc57eaad (diff)
The result of getopt() should be compared to -1, not EOF, per
pgsql-hackers discussion of this date.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/dbase/dbf2pg.c5
-rw-r--r--contrib/oid2name/oid2name.c2
-rw-r--r--contrib/pgbench/pgbench.c4
3 files changed, 7 insertions, 4 deletions
diff --git a/contrib/dbase/dbf2pg.c b/contrib/dbase/dbf2pg.c
index 8b7d989a072..5f5e9d2823f 100644
--- a/contrib/dbase/dbf2pg.c
+++ b/contrib/dbase/dbf2pg.c
@@ -16,6 +16,9 @@
#ifdef HAVE_ICONV_H
#include <iconv.h>
#endif
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#endif
#include "libpq-fe.h"
#include "dbf.h"
@@ -673,7 +676,7 @@ main(int argc, char **argv)
char *query;
dbhead *dbh;
- while ((i = getopt(argc, argv, "DWflucvh:b:e:d:t:s:B:U:F:T:")) != EOF)
+ while ((i = getopt(argc, argv, "DWflucvh:b:e:d:t:s:B:U:F:T:")) != -1)
{
switch (i)
{
diff --git a/contrib/oid2name/oid2name.c b/contrib/oid2name/oid2name.c
index 2d4e2b8d0f8..dfd261240ac 100644
--- a/contrib/oid2name/oid2name.c
+++ b/contrib/oid2name/oid2name.c
@@ -67,7 +67,7 @@ get_opts(int argc, char **argv, struct options * my_opts)
my_opts->remotepass = 0;
/* get opts */
- while ((c = getopt(argc, argv, "H:p:U:P:d:t:o:xh?")) != EOF)
+ while ((c = getopt(argc, argv, "H:p:U:P:d:t:o:xh?")) != -1)
{
switch (c)
{
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index 8d20caf3e4c..56d6a7128a6 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -1,5 +1,5 @@
/*
- * $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.13 2001/11/05 17:46:23 momjian Exp $
+ * $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.14 2002/01/10 01:11:45 tgl Exp $
*
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
* written by Tatsuo Ishii
@@ -641,7 +641,7 @@ main(int argc, char **argv)
PGconn *con;
PGresult *res;
- while ((c = getopt(argc, argv, "ih:nvp:dc:t:s:U:P:CS")) != EOF)
+ while ((c = getopt(argc, argv, "ih:nvp:dc:t:s:U:P:CS")) != -1)
{
switch (c)
{