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

Commit7c957ec

Browse files
author
Michael Meskes
committed
Do not use an empty hostname.
When trying to connect to a given database libecpg should not try using anempty hostname if no hostname was given.
1 parentc01bc51 commit7c957ec

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
325325

326326
if (dbname!=NULL)
327327
{
328-
/* get the detail informationout of dbname */
328+
/* get the detail informationfrom dbname */
329329
if (strncmp(dbname,"tcp:",4)==0||strncmp(dbname,"unix:",5)==0)
330330
{
331331
intoffset=0;
@@ -344,7 +344,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
344344
/*------
345345
* new style:
346346
*<tcp|unix>:postgresql://server[:port|:/unixsocket/path:]
347-
*[/dbname][?options]
347+
*[/db-name][?options]
348348
*------
349349
*/
350350
offset+=strlen("postgresql://");
@@ -427,8 +427,11 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
427427
}
428428
else
429429
{
430-
host=ecpg_strdup(dbname+offset,lineno);
431-
connect_params++;
430+
if (*(dbname+offset)!='\0')
431+
{
432+
host=ecpg_strdup(dbname+offset,lineno);
433+
connect_params++;
434+
}
432435
}
433436

434437
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp