summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-26 11:16:35 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-26 11:16:35 +0000
commita8b2bda76008b5ff5f58cd60276c6f5d1f2b2538 (patch)
treecbe78c9e0ff343bb028c1ae1894ba20816535bf4 /parse.y
parentcad814b5485493a5db2543bcf876bc117055cbf7 (diff)
merges r20952 from trunk into ruby_1_9_1.
* string.c (rb_external_str_new_with_enc): set ASCII-8BIT if encoding is US-ASCII and string contains 8bit characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@21072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y9
1 files changed, 2 insertions, 7 deletions
diff --git a/parse.y b/parse.y
index 843f14fda1..29b60c9535 100644
--- a/parse.y
+++ b/parse.y
@@ -7931,13 +7931,8 @@ gettable_gen(struct parser_params *parser, ID id)
return NEW_FALSE();
}
else if (id == keyword__FILE__) {
- VALUE str = rb_external_str_new_with_enc(ruby_sourcefile, strlen(ruby_sourcefile),
- rb_filesystem_encoding());
- if (rb_enc_str_coderange(str) != ENC_CODERANGE_7BIT &&
- ENCODING_GET(str) == rb_usascii_encindex()) {
- rb_enc_associate(str, rb_ascii8bit_encoding());
- }
- return NEW_STR(str);
+ return NEW_STR(rb_external_str_new_with_enc(ruby_sourcefile, strlen(ruby_sourcefile),
+ rb_filesystem_encoding()));
}
else if (id == keyword__LINE__) {
return NEW_LIT(INT2FIX(ruby_sourceline));