Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 45f9217

Browse files
committed
Ignore PGPORT environment variable if it is an empty string.
1 parent ff6012e commit 45f9217

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.156 2000/12/22 07:59:32 ishii Exp $
11+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.157 2000/12/31 18:15:58 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -440,7 +440,8 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions,
440440

441441
if (pgport == NULL || pgport[0] == '\0')
442442
{
443-
if ((tmp = getenv("PGPORT")) == NULL)
443+
tmp = getenv("PGPORT");
444+
if (tmp == NULL || tmp[0] == '\0')
444445
tmp = DEF_PGPORT_STR;
445446
conn->pgport = strdup(tmp);
446447
}

0 commit comments

Comments
 (0)