зеркало из https://github.com/github/ruby.git
* parse.y (parser_str_new, rb_intern3): ascii only string literal is US-ASCII.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
1ccb0642ed
Коммит
5e3bb6c3ae
|
@ -2,6 +2,9 @@ Thu Jan 24 01:00:34 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
|||
|
||||
* encoding.{c, h} (rb_usascii_encoding): added.
|
||||
|
||||
* parse.y (parser_str_new, rb_intern3): ascii only string literal is
|
||||
US-ASCII.
|
||||
|
||||
Wed Jan 23 23:54:40 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* sprintf.c: fix comment. [ruby-dev:33275]
|
||||
|
|
6
parse.y
6
parse.y
|
@ -4845,7 +4845,7 @@ parser_str_new(const char *p, long n, rb_encoding *enc, int func)
|
|||
if (!(func & STR_FUNC_REGEXP) &&
|
||||
rb_enc_asciicompat(enc) &&
|
||||
rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) {
|
||||
rb_enc_associate(str, rb_ascii8bit_encoding());
|
||||
rb_enc_associate(str, rb_usascii_encoding());
|
||||
}
|
||||
|
||||
return str;
|
||||
|
@ -8976,7 +8976,7 @@ rb_intern3(const char *name, long len, rb_encoding *enc)
|
|||
}
|
||||
}
|
||||
if (m - name < len) id = ID_JUNK;
|
||||
if (enc != rb_ascii8bit_encoding()) {
|
||||
if (enc != rb_usascii_encoding()) {
|
||||
/*
|
||||
* this clause makes sense only when called from other than
|
||||
* rb_intern_str() taking care of code-range.
|
||||
|
@ -8985,7 +8985,7 @@ rb_intern3(const char *name, long len, rb_encoding *enc)
|
|||
for (; m <= name + len; ++m) {
|
||||
if (!ISASCII(*m)) goto mbstr;
|
||||
}
|
||||
enc = rb_ascii8bit_encoding();
|
||||
enc = rb_usascii_encoding();
|
||||
}
|
||||
mbstr:;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче