Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit71a185a

Browse files
author
Michael Meskes
committed
ECPG connect routine only checked for NULL to find empty parameters, but user and password can also be "".
1 parentcd86869 commit71a185a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎src/interfaces/ecpg/ecpglib/connect.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
#definePOSTGRES_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

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp