1010 *
1111 *
1212 * IDENTIFICATION
13- * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.97 2003/04/12 22:28:33 tgl Exp $
13+ * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.98 2003/04/13 04:07:17 tgl Exp $
1414 *
1515 *-------------------------------------------------------------------------
1616 */
@@ -69,16 +69,11 @@ static List *tokenize_file(FILE *file);
6969static char * tokenize_inc_file (const char * inc_filename );
7070
7171/*
72- * Some standard C libraries, including GNU, have an isblank() function.
73- * Others, including Solaris, do not. So we have our own. Watch out for
74- * macro-ized versions, too.
72+ * isblank() exists in the ISO C99 spec, but it's not very portable yet,
73+ * so provide our own version.
7574 */
76- #ifdef isblank
77- #undef isblank
78- #endif
79-
8075static bool
81- isblank (const char c )
76+ pg_isblank (const char c )
8277{
8378return c == ' ' || c == '\t' || c == '\r' ;
8479}
@@ -104,7 +99,7 @@ next_token(FILE *fp, char *buf, const int bufsz)
10499bool was_quote = false;
105100
106101/* Move over initial whitespace and commas */
107- while ((c = getc (fp ))!= EOF && (isblank (c )|| c == ',' ))
102+ while ((c = getc (fp ))!= EOF && (pg_isblank (c )|| c == ',' ))
108103;
109104
110105if (c != EOF && c != '\n' )
@@ -114,7 +109,7 @@ next_token(FILE *fp, char *buf, const int bufsz)
114109 * unquoted comma, or unquoted whitespace.
115110 */
116111while (c != EOF && c != '\n' &&
117- (!isblank (c )|| in_quote == true))
112+ (!pg_isblank (c )|| in_quote == true))
118113{
119114/* skip comments to EOL */
120115if (c == '#' && !in_quote )
@@ -141,7 +136,7 @@ next_token(FILE *fp, char *buf, const int bufsz)
141136* buf ++ = c ;
142137
143138/* We pass back the comma so the caller knows there is more */
144- if ((isblank (c )|| c == ',' )&& !in_quote )
139+ if ((pg_isblank (c )|| c == ',' )&& !in_quote )
145140break ;
146141
147142/* Literal double-quote is two double-quotes */
@@ -1050,14 +1045,14 @@ interpret_ident_response(char *ident_response,
10501045int i ;/* Index into *response_type */
10511046
10521047cursor ++ ;/* Go over colon */
1053- while (isblank (* cursor ))
1048+ while (pg_isblank (* cursor ))
10541049cursor ++ ;/* skip blanks */
10551050i = 0 ;
1056- while (* cursor != ':' && * cursor != '\r' && !isblank (* cursor )&&
1051+ while (* cursor != ':' && * cursor != '\r' && !pg_isblank (* cursor )&&
10571052i < (int ) (sizeof (response_type )- 1 ))
10581053response_type [i ++ ]= * cursor ++ ;
10591054response_type [i ]= '\0' ;
1060- while (isblank (* cursor ))
1055+ while (pg_isblank (* cursor ))
10611056cursor ++ ;/* skip blanks */
10621057if (strcmp (response_type ,"USERID" )!= 0 )
10631058return false;
@@ -1083,7 +1078,7 @@ interpret_ident_response(char *ident_response,
10831078int i ;/* Index into *ident_user */
10841079
10851080cursor ++ ;/* Go over colon */
1086- while (isblank (* cursor ))
1081+ while (pg_isblank (* cursor ))
10871082cursor ++ ;/* skip blanks */
10881083/* Rest of line is user name. Copy it over. */
10891084i = 0 ;