88 *
99 *
1010 * 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 $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -2367,7 +2367,7 @@ parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage)
23672367{
23682368char * service = conninfo_getval (options ,"service" );
23692369char * serviceFile = SYSCONFDIR "/pg_service.conf" ;
2370- int group_found = 0 ;
2370+ bool group_found = false ;
23712371int linenr = 0 ,
23722372i ;
23732373
@@ -2431,9 +2431,9 @@ parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage)
24312431
24322432if (strncmp (line + 1 ,service ,strlen (service ))== 0 &&
24332433line [strlen (service )+ 1 ]== ']' )
2434- group_found = 1 ;
2434+ group_found = true ;
24352435else
2436- group_found = 0 ;
2436+ group_found = false ;
24372437}
24382438else
24392439{
@@ -2445,7 +2445,7 @@ parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage)
24452445 */
24462446char * key ,
24472447* val ;
2448- int found_keyword ;
2448+ bool found_keyword ;
24492449
24502450key = line ;
24512451val = strchr (line ,'=' );
@@ -2460,32 +2460,18 @@ parseServiceInfo(PQconninfoOption *options, PQExpBuffer errorMessage)
24602460}
24612461* val ++ = '\0' ;
24622462
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-
24772463/*
24782464 * Set the parameter --- but don't override any
24792465 * previous explicit setting.
24802466 */
2481- found_keyword = 0 ;
2467+ found_keyword = false ;
24822468for (i = 0 ;options [i ].keyword ;i ++ )
24832469{
24842470if (strcmp (options [i ].keyword ,key )== 0 )
24852471{
24862472if (options [i ].val == NULL )
24872473options [i ].val = strdup (val );
2488- found_keyword = 1 ;
2474+ found_keyword = true ;
24892475break ;
24902476}
24912477}