|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.219 2003/01/07 04:25:29 momjian Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.220 2003/01/08 16:21:53 momjian Exp $ |
12 | 12 | * |
13 | 13 | *------------------------------------------------------------------------- |
14 | 14 | */ |
@@ -133,7 +133,7 @@ static const PQconninfoOption PQconninfoOptions[] = { |
133 | 133 |
|
134 | 134 | {"hostaddr","PGHOSTADDR",NULL,NULL, |
135 | 135 | "Database-Host-IP-Address","",45}, |
136 | | -
|
| 136 | + |
137 | 137 | {"port","PGPORT",DEF_PGPORT_STR,NULL, |
138 | 138 | "Database-Port","",6}, |
139 | 139 |
|
@@ -2338,12 +2338,6 @@ parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage) |
2338 | 2338 | return1; |
2339 | 2339 | } |
2340 | 2340 |
|
2341 | | -/* If not already set, set the database name to the name of the service */ |
2342 | | -for (i=0;options[i].keyword;i++) |
2343 | | -if (strcmp(options[i].keyword,"dbname")==0) |
2344 | | -if (options[i].val==NULL) |
2345 | | -options[i].val=strdup(service); |
2346 | | - |
2347 | 2341 | while ((line=fgets(buf,MAXBUFSIZE-1,f))!=NULL) |
2348 | 2342 | { |
2349 | 2343 | linenr++; |
@@ -2408,6 +2402,16 @@ parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage) |
2408 | 2402 | fclose(f); |
2409 | 2403 | return3; |
2410 | 2404 | } |
| 2405 | + |
| 2406 | +/* |
| 2407 | + *If not already set, set the database name to the |
| 2408 | + *name of the service |
| 2409 | + */ |
| 2410 | +for (i=0;options[i].keyword;i++) |
| 2411 | +if (strcmp(options[i].keyword,"dbname")==0) |
| 2412 | +if (options[i].val==NULL) |
| 2413 | +options[i].val=strdup(service); |
| 2414 | + |
2411 | 2415 | val=line+strlen(line)+1; |
2412 | 2416 |
|
2413 | 2417 | found_keyword=0; |
|