Skip to content

Commit c1e0643

Browse files
committed
Fix broken isspace in other parsing code
1 parent c2f79b8 commit c1e0643

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

contrib/pg_hint_plan/pg_hint_plan.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ PG_MODULE_MAGIC;
9090
errdetail detail))
9191

9292
#define skip_space(str) \
93-
while (isspace(*str) && (*str &0x80)== 0) \
93+
while (isspace(*str) && (*str & 0x80)== 0) \
9494
str++;
9595

9696
enum
@@ -901,7 +901,7 @@ quote_value(StringInfo buf, const char *value)
901901

902902
for (str = value; *str != '\0'; str++)
903903
{
904-
if (isspace(*str) || *str == '(' || *str == ')' || *str == '"')
904+
if ((isspace(*str) && (((*str) & 0x80)==0)) || *str == '(' || *str == ')' || *str == '"')
905905
{
906906
need_quote = true;
907907
appendStringInfoCharMacro(buf, '"');
@@ -1249,7 +1249,7 @@ parse_keyword(const char *str, StringInfo buf)
12491249
{
12501250
skip_space(str);
12511251

1252-
while (!isspace(*str) && *str != '(' && *str != '\0')
1252+
while (!(isspace(*str)&&(*str & 0x80)==0) && *str != '(' && *str != '\0')
12531253
appendStringInfoCharMacro(buf, *str++);
12541254

12551255
return str;
@@ -1329,7 +1329,7 @@ parse_quoted_value(const char *str, char **word, bool truncate)
13291329
break;
13301330
}
13311331
}
1332-
else if (isspace(*str) || *str == '(' || *str == ')' || *str == '"' ||
1332+
else if ((isspace(*str)&&((*str & 0x80)==0)) || *str == '(' || *str == ')' || *str == '"' ||
13331333
*str == '\0')
13341334
break;
13351335

@@ -1699,7 +1699,7 @@ get_hints_from_comment(const char *p)
16991699
if (!(*p >= '0' && *p <= '9') &&
17001700
!(*p >= 'A' && *p <= 'Z') &&
17011701
!(*p >= 'a' && *p <= 'z') &&
1702-
!isspace(*p) &&
1702+
(!isspace(*p)|| (*p &0x80)) &&
17031703
*p != '_' &&
17041704
*p != ',' &&
17051705
*p != '(' && *p != ')')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy