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

Commit235a569

Browse files
committed
Fix multi-byte+locale problem
1 parent6febecc commit235a569

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

‎src/backend/regex/regcomp.c

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ extern"C"
9595
staticvoidp_b_eclass(structparse*p,cset*cs);
9696
staticpg_wcharp_b_symbol(structparse*p);
9797
staticcharp_b_coll_elem(structparse*p,intendc);
98+
#ifdefMULTIBYTE
99+
staticunsignedcharothercase(intch);
100+
#else
98101
staticcharothercase(intch);
102+
#endif
99103
staticvoidbothcases(structparse*p,intch);
100104
staticvoidordinary(structparse*p,intch);
101105
staticvoidnonnewline(structparse*p);
@@ -1032,18 +1036,34 @@ intendc;/* name ended by endc,']' */
10321036
- othercase - return the case counterpart of an alphabetic
10331037
== static char othercase(int ch);
10341038
*/
1035-
staticchar/* if no counterpart, return ch */
1039+
#ifdefMULTIBYTE
1040+
staticunsignedchar/* if no counterpart, return ch */
1041+
#else
1042+
staticchar/* if no counterpart, return ch */
1043+
#endif
10361044
othercase(ch)
10371045
intch;
10381046
{
10391047
assert(pg_isalpha(ch));
10401048
if (pg_isupper(ch))
1049+
#ifdefMULTIBYTE
1050+
return (unsignedchar)tolower(ch);
1051+
#else
10411052
returntolower(ch);
1053+
#endif
10421054
elseif (pg_islower(ch))
1055+
#ifdefMULTIBYTE
1056+
return (unsignedchar)toupper(ch);
1057+
#else
10431058
returntoupper(ch);
1059+
#endif
10441060
else
10451061
/* peculiar, but could happen */
1062+
#ifdefMULTIBYTE
1063+
return (unsignedchar)ch;
1064+
#else
10461065
returnch;
1066+
#endif
10471067
}
10481068

10491069
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp