[#41778] [Bug #3515] FreeBSD wrongly raises ECONNRESET on close(2) — Yui NARUSE <redmine@...>

Bug #3515: FreeBSD wrongly raises ECONNRESET on close(2)

12 messages 2010/07/02

[ruby-dev:41816] Re: [Bug #3522] String::size return invalid size on mswin64

From: Yusuke ENDOH <mame@...>
Date: 2010-07-05 13:31:24 UTC
List: ruby-dev #41816
遠藤です。

2010年7月2日19:05 shintaro kuwamoto <redmine@ruby-lang.org>:
> x64-mswin64_90環境で、15文字以上のUTF-8文字列のサイズが正常に取得できません。
>
> Z:\ruby-trunk\build>ruby -e"puts \"1234567890123\u{3042}\".size"
> 14
>
> Z:\ruby-trunk\build>ruby -e"puts \"12345678901234\u{3042}\".size"
> 19


ひょっとして以下のパッチで直らないでしょうか。


diff --git a/string.c b/string.c
index 703797f..510c04e 100644
--- a/string.c
+++ b/string.c
@@ -141,7 +141,7 @@ static inline const char *
 search_nonascii(const char *p, const char *e)
 {
 #if SIZEOF_VALUE == 8
-# define NONASCII_MASK 0x8080808080808080LL
+# define NONASCII_MASK 0x8080808080808080ULL
 #elif SIZEOF_VALUE == 4
 # define NONASCII_MASK 0x80808080UL
 #endif

-- 
Yusuke Endoh <mame@tsg.ne.jp>

In This Thread