8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.264 2003/11/29 19:52:11 pgsql Exp $
11
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.265 2003/12/19 21:50:54 momjian Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -2367,7 +2367,7 @@ parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage)
2367
2367
{
2368
2368
char * service = conninfo_getval (options , "service" );
2369
2369
char * serviceFile = SYSCONFDIR "/pg_service.conf" ;
2370
- int group_found = 0 ;
2370
+ bool group_found = false ;
2371
2371
int linenr = 0 ,
2372
2372
i ;
2373
2373
@@ -2431,9 +2431,9 @@ parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage)
2431
2431
2432
2432
if (strncmp (line + 1 , service , strlen (service )) == 0 &&
2433
2433
line [strlen (service ) + 1 ] == ']' )
2434
- group_found = 1 ;
2434
+ group_found = true ;
2435
2435
else
2436
- group_found = 0 ;
2436
+ group_found = false ;
2437
2437
}
2438
2438
else
2439
2439
{
@@ -2445,7 +2445,7 @@ parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage)
2445
2445
*/
2446
2446
char * key ,
2447
2447
* val ;
2448
- int found_keyword ;
2448
+ bool found_keyword ;
2449
2449
2450
2450
key = line ;
2451
2451
val = strchr (line , '=' );
@@ -2460,32 +2460,18 @@ parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage)
2460
2460
}
2461
2461
* val ++ = '\0' ;
2462
2462
2463
- /*
2464
- * If not already set, set the database name to the
2465
- * name of the service
2466
- */
2467
- for (i = 0 ; options [i ].keyword ; i ++ )
2468
- {
2469
- if (strcmp (options [i ].keyword , "dbname" ) == 0 )
2470
- {
2471
- if (options [i ].val == NULL )
2472
- options [i ].val = strdup (service );
2473
- break ;
2474
- }
2475
- }
2476
-
2477
2463
/*
2478
2464
* Set the parameter --- but don't override any
2479
2465
* previous explicit setting.
2480
2466
*/
2481
- found_keyword = 0 ;
2467
+ found_keyword = false ;
2482
2468
for (i = 0 ; options [i ].keyword ; i ++ )
2483
2469
{
2484
2470
if (strcmp (options [i ].keyword , key ) == 0 )
2485
2471
{
2486
2472
if (options [i ].val == NULL )
2487
2473
options [i ].val = strdup (val );
2488
- found_keyword = 1 ;
2474
+ found_keyword = true ;
2489
2475
break ;
2490
2476
}
2491
2477
}
0 commit comments