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

Commit2e5353b

Browse files
committed
Another unintentional behavior change in commite9931bf.
Reported-by: Noah Misch <noah@leadboat.com>Reviewed-by: Noah Misch <noah@leadboat.com>Discussion:https://postgr.es/m/20250412123430.8c.nmisch@google.com
1 parentb107744 commit2e5353b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/backend/regex/regc_pg_locale.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,10 +559,16 @@ pg_wc_toupper(pg_wchar c)
559559
casePG_REGEX_STRATEGY_BUILTIN:
560560
returnunicode_uppercase_simple(c);
561561
casePG_REGEX_STRATEGY_LIBC_WIDE:
562+
/* force C behavior for ASCII characters, per comments above */
563+
if (pg_regex_locale->is_default&&c <= (pg_wchar)127)
564+
returnpg_ascii_toupper((unsignedchar)c);
562565
if (sizeof(wchar_t) >=4||c <= (pg_wchar)0xFFFF)
563566
returntowupper_l((wint_t)c,pg_regex_locale->info.lt);
564567
/* FALL THRU */
565568
casePG_REGEX_STRATEGY_LIBC_1BYTE:
569+
/* force C behavior for ASCII characters, per comments above */
570+
if (pg_regex_locale->is_default&&c <= (pg_wchar)127)
571+
returnpg_ascii_toupper((unsignedchar)c);
566572
if (c <= (pg_wchar)UCHAR_MAX)
567573
returntoupper_l((unsignedchar)c,pg_regex_locale->info.lt);
568574
returnc;
@@ -587,10 +593,16 @@ pg_wc_tolower(pg_wchar c)
587593
casePG_REGEX_STRATEGY_BUILTIN:
588594
returnunicode_lowercase_simple(c);
589595
casePG_REGEX_STRATEGY_LIBC_WIDE:
596+
/* force C behavior for ASCII characters, per comments above */
597+
if (pg_regex_locale->is_default&&c <= (pg_wchar)127)
598+
returnpg_ascii_tolower((unsignedchar)c);
590599
if (sizeof(wchar_t) >=4||c <= (pg_wchar)0xFFFF)
591600
returntowlower_l((wint_t)c,pg_regex_locale->info.lt);
592601
/* FALL THRU */
593602
casePG_REGEX_STRATEGY_LIBC_1BYTE:
603+
/* force C behavior for ASCII characters, per comments above */
604+
if (pg_regex_locale->is_default&&c <= (pg_wchar)127)
605+
returnpg_ascii_tolower((unsignedchar)c);
594606
if (c <= (pg_wchar)UCHAR_MAX)
595607
returntolower_l((unsignedchar)c,pg_regex_locale->info.lt);
596608
returnc;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp