https://git.reactos.org/?p=reactos.git;a=commitdiff;h=64527aa94823264d30bce…
commit 64527aa94823264d30bceb604f65d8a15f1ad6cd
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Wed Feb 1 18:29:41 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Feb 1 18:29:41 2023 +0900
[RICHED20] Fix word break procedure for punct (#5021)
Fix the hyperlink on Chinese Rapps. Check punctuation in the word break procedure by
using iswpunct function.
Wine Bug:
https://bugs.winehq.org/show_bug.cgi?id=54419
CORE-17091
---
dll/win32/riched20/string.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/dll/win32/riched20/string.c b/dll/win32/riched20/string.c
index cfb149a93e2..f89f602f593 100644
--- a/dll/win32/riched20/string.c
+++ b/dll/win32/riched20/string.c
@@ -161,7 +161,9 @@ void ME_StrDeleteV(ME_String *s, int nVChar, int nChars)
static int
ME_WordBreakProc(LPWSTR s, INT start, INT len, INT code)
{
+#ifndef __REACTOS__
/* FIXME: Native also knows about punctuation */
+#endif
TRACE("s==%s, start==%d, len==%d, code==%d\n",
debugstr_wn(s, len), start, len, code);
@@ -173,13 +175,23 @@ ME_WordBreakProc(LPWSTR s, INT start, INT len, INT code)
case WB_MOVEWORDLEFT:
while (start && ME_IsWSpace(s[start - 1]))
start--;
+#ifdef __REACTOS__
+ while (start && !ME_IsWSpace(s[start - 1]) && !iswpunct(s[start -
1]))
+ start--;
+#else
while (start && !ME_IsWSpace(s[start - 1]))
start--;
+#endif
return start;
case WB_RIGHT:
case WB_MOVEWORDRIGHT:
+#ifdef __REACTOS__
+ while (start < len && !ME_IsWSpace(s[start]) &&
!iswpunct(s[start]))
+ start++;
+#else
while (start < len && !ME_IsWSpace(s[start]))
start++;
+#endif
while (start < len && ME_IsWSpace(s[start]))
start++;
return start;