summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-10 17:07:38 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-10 17:07:38 +0000
commitdcbbc9e6fd8b8f6105328f634eaf4b2361a4961d (patch)
tree4e32ca4e368e6d158e8dad683511ece4f486d553
parent0d8bcbb2f56f840e17fb1fac4d66dfe631a3f7c9 (diff)
downloadruby-dcbbc9e6fd8b8f6105328f634eaf4b2361a4961d.tar.gz
ruby-dcbbc9e6fd8b8f6105328f634eaf4b2361a4961d.tar.xz
ruby-dcbbc9e6fd8b8f6105328f634eaf4b2361a4961d.zip
* 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] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--parse.y9
-rw-r--r--re.c4
3 files changed, 17 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index fbf82ba20..95a106da2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Fri Sep 11 02:06:44 2009 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * 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@marc-andre.ca>
* lib/net/http.rb (fetch): rdoc fix, patch by Arthur Schreiber.
diff --git a/parse.y b/parse.y
index 121029d19..26283aa6e 100644
--- a/parse.y
+++ b/parse.y
@@ -5598,8 +5598,13 @@ parser_regx_options(struct parser_params *parser)
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);
diff --git a/re.c b/re.c
index 2d7ea2c4c..e22c8c04c 100644
--- a/re.c
+++ b/re.c
@@ -287,7 +287,7 @@ rb_char_to_option_kcode(int c, int *option, int *kcode)
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 @@ rb_char_to_option_kcode(int c, int *option, int *kcode)
*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;