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

Commit17bcdd0

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 parent8d65ea2 commit17bcdd0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

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

327327
if (dbname!=NULL)
328328
{
329-
/* get the detail informationout of dbname */
329+
/* get the detail informationfrom dbname */
330330
if (strncmp(dbname,"tcp:",4)==0||strncmp(dbname,"unix:",5)==0)
331331
{
332332
intoffset=0;
@@ -345,7 +345,7 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
345345
/*------
346346
* new style:
347347
*<tcp|unix>:postgresql://server[:port|:/unixsocket/path:]
348-
*[/dbname][?options]
348+
*[/db-name][?options]
349349
*------
350350
*/
351351
offset+=strlen("postgresql://");
@@ -420,8 +420,10 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
420420
}
421421
}
422422
else
423-
host=ecpg_strdup(dbname+offset,lineno);
424-
423+
{
424+
if (*(dbname+offset)!='\0')
425+
host=ecpg_strdup(dbname+offset,lineno);
426+
}
425427
}
426428
}
427429
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp