ruby-changes:1817
From: ko1@a...
Date: 30 Aug 2007 04:16:15 +0900
Subject: [ruby-changes:1817] matz - Ruby:r13308 (trunk): * string.c (str_gsub): should not use mbclen2() which has broken API.
matz 2007-08-30 04:16:02 +0900 (Thu, 30 Aug 2007) New Revision: 13308 Modified files: trunk/ChangeLog trunk/include/ruby/re.h trunk/re.c trunk/string.c trunk/version.h Log: * string.c (str_gsub): should not use mbclen2() which has broken API. * re.c: remove rb_reg_mbclen2(). http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/version.h?r1=13308&r2=13307 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=13308&r2=13307 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13308&r2=13307 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/include/ruby/re.h?r1=13308&r2=13307 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/re.c?r1=13308&r2=13307 Index: include/ruby/re.h =================================================================== --- include/ruby/re.h (revision 13307) +++ include/ruby/re.h (revision 13308) @@ -45,9 +45,6 @@ RUBY_EXTERN int ruby_ignorecase; -int rb_reg_mbclen2(unsigned int, VALUE); -#define mbclen2(c,re) rb_reg_mbclen2((c),(re)) - #if defined(__cplusplus) #if 0 { /* satisfy cc-mode */ Index: re.c =================================================================== --- re.c (revision 13307) +++ re.c (revision 13308) @@ -376,14 +376,6 @@ } } -int -rb_reg_mbclen2(unsigned int c, VALUE re) -{ - char uc = (unsigned char)c; - - return rb_enc_mbclen(&uc, rb_enc_get(re)); -} - static void rb_reg_check(VALUE re) { Index: ChangeLog =================================================================== --- ChangeLog (revision 13307) +++ ChangeLog (revision 13308) @@ -2,6 +2,12 @@ * lib/open-uri.rb: add :ftp_active_mode option. +Wed Aug 29 14:55:28 2007 Yukihiro Matsumoto <matz@r...> + + * string.c (str_gsub): should not use mbclen2() which has broken API. + + * re.c: remove rb_reg_mbclen2(). + Wed Aug 29 12:48:17 2007 Nobuyoshi Nakada <nobu@r...> * parse.y (aref_args): args may not be a list. [ruby-dev:31592] Index: string.c =================================================================== --- string.c (revision 13307) +++ string.c (revision 13308) @@ -2244,7 +2244,8 @@ int iter = 0; char *buf, *bp, *sp, *cp; int tainted = 0; - + rb_encoding *enc; + switch (argc) { case 1: RETURN_ENUMERATOR(str, argc, argv); @@ -2260,6 +2261,7 @@ } pat = get_pat(argv[0], 1); + enc = rb_enc_get(pat); offset=0; n=0; beg = rb_reg_search(pat, str, 0, 0); if (beg < 0) { @@ -2314,7 +2316,7 @@ * in order to prevent infinite loops. */ if (RSTRING_LEN(str) <= END(0)) break; - len = mbclen2(RSTRING_PTR(str)[END(0)], pat); + len = rb_enc_mbclen(RSTRING_PTR(str)+END(0), enc); memcpy(bp, RSTRING_PTR(str)+END(0), len); bp += len; offset = END(0) + len; Index: version.h =================================================================== --- version.h (revision 13307) +++ version.h (revision 13308) @@ -1,7 +1,7 @@ #define RUBY_VERSION "1.9.0" -#define RUBY_RELEASE_DATE "2007-08-29" +#define RUBY_RELEASE_DATE "2007-08-30" #define RUBY_VERSION_CODE 190 -#define RUBY_RELEASE_CODE 20070829 +#define RUBY_RELEASE_CODE 20070830 #define RUBY_PATCHLEVEL 0 #define RUBY_VERSION_MAJOR 1 @@ -9,7 +9,7 @@ #define RUBY_VERSION_TEENY 0 #define RUBY_RELEASE_YEAR 2007 #define RUBY_RELEASE_MONTH 8 -#define RUBY_RELEASE_DAY 29 +#define RUBY_RELEASE_DAY 30 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml