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 $ */
22
33#define POSTGRES_ECPG_INTERNAL
44#include "postgres_fe.h"
@@ -475,7 +475,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
475475 host ? host : "<DEFAULT>" ,
476476 port ? (ecpg_internal_regression_mode ? "<REGRESSION_PORT>" : port ) : "<DEFAULT>" ,
477477 options ? "with options " : "" , options ? options : "" ,
478- user ? "for user " : "" , user ? user : "" );
478+ ( user && strlen ( user ) > 0 ) ? "for user " : "" , user ? user : "" );
479479
480480 connect_string = ecpg_alloc (strlen_or_null (host )
481481 + strlen_or_null (port )
@@ -494,8 +494,8 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
494494 realname ? "dbname=" : "" , realname ? realname : "" ,
495495 host ? "host=" : "" , host ? host : "" ,
496496 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 : "" ,
499499 options ? options : "" );
500500
501501 /*
0 commit comments