ruby-changes:13084
From: naruse <ko1@a...>
Date: Fri, 11 Sep 2009 02:07:56 +0900 (JST)
Subject: [ruby-changes:13084] Ruby:r24832 (trunk): * parse.y (rb_char_to_option_kcode): ASCII-8BIT should also delay.
naruse 2009-09-11 02:07:38 +0900 (Fri, 11 Sep 2009) New Revision: 24832 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24832 Log: * parse.y (rb_char_to_option_kcode): ASCII-8BIT should also delay. * re.c (parser_regx_options): return rb_ascii8bit_encindex on ASCII-8BIT. [ruby-dev:39300] Modified files: trunk/ChangeLog trunk/parse.y trunk/re.c Index: ChangeLog =================================================================== --- ChangeLog (revision 24831) +++ ChangeLog (revision 24832) @@ -1,3 +1,11 @@ +Fri Sep 11 02:06:44 2009 NARUSE, Yui <naruse@r...> + + * parse.y (rb_char_to_option_kcode): ASCII-8BIT should + also delay. + + * re.c (parser_regx_options): return rb_ascii8bit_encindex on + ASCII-8BIT. [ruby-dev:39300] + Fri Sep 11 01:14:00 2009 Marc-Andre Lafortune <ruby-core@m...> * lib/net/http.rb (fetch): rdoc fix, patch by Arthur Schreiber. Index: re.c =================================================================== --- re.c (revision 24831) +++ re.c (revision 24832) @@ -287,7 +287,7 @@ switch (c) { case 'n': - *kcode = -1; + *kcode = rb_ascii8bit_encindex(); return (*option = ARG_ENCODING_NONE); case 'e': *kcode = rb_enc_find_index("EUC-JP"); @@ -296,7 +296,7 @@ *kcode = rb_enc_find_index("Windows-31J"); break; case 'u': - *kcode = rb_enc_find_index("UTF-8"); + *kcode = rb_utf8_encindex(); break; default: *kcode = -1; Index: parse.y =================================================================== --- parse.y (revision 24831) +++ parse.y (revision 24832) @@ -5598,8 +5598,13 @@ options |= RE_OPTION_ONCE; } else if (rb_char_to_option_kcode(c, &opt, &kc)) { - kopt = opt; - if (kc >= 0) kcode = c; + if (kc >= 0) { + if (kc != rb_ascii8bit_encindex()) kcode = c; + kopt = opt; + } + else { + options |= opt; + } } else { tokadd(c); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/