1
- /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.54 2009/06/11 14:49:13 momjian Exp $ */
1
+ /* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.55 2010/05/07 19:35:03 meskes Exp $ */
2
2
3
3
#define POSTGRES_ECPG_INTERNAL
4
4
#include "postgres_fe.h"
@@ -475,7 +475,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
475
475
host ? host : "<DEFAULT>" ,
476
476
port ? (ecpg_internal_regression_mode ? "<REGRESSION_PORT>" : port ) : "<DEFAULT>" ,
477
477
options ? "with options " : "" , options ? options : "" ,
478
- user ? "for user " : "" , user ? user : "" );
478
+ ( user && strlen ( user ) > 0 ) ? "for user " : "" , user ? user : "" );
479
479
480
480
connect_string = ecpg_alloc (strlen_or_null (host )
481
481
+ strlen_or_null (port )
@@ -494,8 +494,8 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
494
494
realname ? "dbname=" : "" , realname ? realname : "" ,
495
495
host ? "host=" : "" , host ? host : "" ,
496
496
port ? "port=" : "" , port ? port : "" ,
497
- user ? "user=" : "" , user ? user : "" ,
498
- passwd ? "password=" : "" , passwd ? passwd : "" ,
497
+ ( user && strlen ( user ) > 0 ) ? "user=" : "" , user ? user : "" ,
498
+ ( passwd && strlen ( passwd ) > 0 ) ? "password=" : "" , passwd ? passwd : "" ,
499
499
options ? options : "" );
500
500
501
501
/*
0 commit comments