aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-connect.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-12-31 18:15:58 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-12-31 18:15:58 +0000
commit45f92179d921e693eaa4dc0c6b393c3368b43c31 (patch)
tree5d7a5a6b14790523596520af0149a314c419b6ad /src/interfaces/libpq/fe-connect.c
parentff6012e275ee726d5e5d0624be432294559c1ae8 (diff)
downloadpostgresql-45f92179d921e693eaa4dc0c6b393c3368b43c31.tar.gz
postgresql-45f92179d921e693eaa4dc0c6b393c3368b43c31.zip
Ignore PGPORT environment variable if it is an empty string.
Diffstat (limited to 'src/interfaces/libpq/fe-connect.c')
-rw-r--r--src/interfaces/libpq/fe-connect.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
index 0c6ff92bea6..059388bcf35 100644
--- a/src/interfaces/libpq/fe-connect.c
+++ b/src/interfaces/libpq/fe-connect.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.156 2000/12/22 07:59:32 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.157 2000/12/31 18:15:58 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -440,7 +440,8 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions,
if (pgport == NULL || pgport[0] == '\0')
{
- if ((tmp = getenv("PGPORT")) == NULL)
+ tmp = getenv("PGPORT");
+ if (tmp == NULL || tmp[0] == '\0')
tmp = DEF_PGPORT_STR;
conn->pgport = strdup(tmp);
}