mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* string.c (rb_enc_str_asciionly_p): use rb_enc_str_coderange.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0d0a8a55fc
commit
33ecb05d51
2 changed files with 7 additions and 10 deletions
|
@ -1,3 +1,7 @@
|
|||
Mon Dec 17 17:07:53 2007 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* string.c (rb_enc_str_asciionly_p): use rb_enc_str_coderange.
|
||||
|
||||
Mon Dec 17 16:39:25 2007 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* string.c (rb_enc_str_coderange): set ENC_CODERANGE_BROKEN using
|
||||
|
|
13
string.c
13
string.c
|
@ -133,16 +133,10 @@ int rb_enc_str_asciionly_p(VALUE str)
|
|||
{
|
||||
rb_encoding *enc = rb_enc_get(str);
|
||||
|
||||
if (rb_enc_asciicompat(enc) &&
|
||||
rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT) {
|
||||
char *ptr = RSTRING_PTR(str);
|
||||
long len = RSTRING_LEN(str);
|
||||
long i;
|
||||
for (i = 0; i < len; i++)
|
||||
if (ptr[i] & 0x80)
|
||||
return Qfalse;
|
||||
if (!rb_enc_asciicompat(enc))
|
||||
return Qfalse;
|
||||
else if (rb_enc_str_coderange(str) == ENC_CODERANGE_7BIT)
|
||||
return Qtrue;
|
||||
}
|
||||
return Qfalse;
|
||||
}
|
||||
|
||||
|
@ -1410,7 +1404,6 @@ static VALUE
|
|||
rb_str_casecmp(VALUE str1, VALUE str2)
|
||||
{
|
||||
long len;
|
||||
int retval;
|
||||
rb_encoding *enc;
|
||||
char *p1, *p1end, *p2, *p2end;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue