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

Commit3fd5fae

Browse files
committed
Second try at avoiding conflicts with system isblank().
1 parentff5456f commit3fd5fae

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

‎src/backend/libpq/hba.c

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
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);
6969
staticchar*tokenize_inc_file(constchar*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-
#ifdefisblank
77-
#undef isblank
78-
#endif
79-
8075
staticbool
81-
isblank(constcharc)
76+
pg_isblank(constcharc)
8277
{
8378
returnc==' '||c=='\t'||c=='\r';
8479
}
@@ -104,7 +99,7 @@ next_token(FILE *fp, char *buf, const int bufsz)
10499
boolwas_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

110105
if (c!=EOF&&c!='\n')
@@ -114,7 +109,7 @@ next_token(FILE *fp, char *buf, const int bufsz)
114109
* unquoted comma, or unquoted whitespace.
115110
*/
116111
while (c!=EOF&&c!='\n'&&
117-
(!isblank(c)||in_quote== true))
112+
(!pg_isblank(c)||in_quote== true))
118113
{
119114
/* skip comments to EOL */
120115
if (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)
145140
break;
146141

147142
/* Literal double-quote is two double-quotes */
@@ -1050,14 +1045,14 @@ interpret_ident_response(char *ident_response,
10501045
inti;/* Index into *response_type */
10511046

10521047
cursor++;/* Go over colon */
1053-
while (isblank(*cursor))
1048+
while (pg_isblank(*cursor))
10541049
cursor++;/* skip blanks */
10551050
i=0;
1056-
while (*cursor!=':'&&*cursor!='\r'&& !isblank(*cursor)&&
1051+
while (*cursor!=':'&&*cursor!='\r'&& !pg_isblank(*cursor)&&
10571052
i< (int) (sizeof(response_type)-1))
10581053
response_type[i++]=*cursor++;
10591054
response_type[i]='\0';
1060-
while (isblank(*cursor))
1055+
while (pg_isblank(*cursor))
10611056
cursor++;/* skip blanks */
10621057
if (strcmp(response_type,"USERID")!=0)
10631058
return false;
@@ -1083,7 +1078,7 @@ interpret_ident_response(char *ident_response,
10831078
inti;/* Index into *ident_user */
10841079

10851080
cursor++;/* Go over colon */
1086-
while (isblank(*cursor))
1081+
while (pg_isblank(*cursor))
10871082
cursor++;/* skip blanks */
10881083
/* Rest of line is user name. Copy it over. */
10891084
i=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp