зеркало из https://github.com/github/ruby.git
* pack.c (pack_pack): set US-ASCII and CODERANGE_7BIT
when quoted-printable ('M') and base64 ('m'). [ruby-dev:37284] * pack.c (pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
83b37cfc4f
Коммит
343deb4c39
|
@ -1,3 +1,11 @@
|
|||
Sat Dec 6 14:35:06 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* pack.c (pack_pack): set US-ASCII and CODERANGE_7BIT
|
||||
when quoted-printable ('M') and base64 ('m').
|
||||
[ruby-dev:37284]
|
||||
|
||||
* pack.c (pack_unpack): ditto.
|
||||
|
||||
Fri Dec 5 21:45:45 2008 Tadayoshi Funaba <tadf@dotrb.org>
|
||||
|
||||
* rational.c (nurat_{to_s,inspect}): performance improvement.
|
||||
|
|
4
pack.c
4
pack.c
|
@ -921,6 +921,7 @@ pack_pack(VALUE ary, VALUE fmt)
|
|||
plen -= todo;
|
||||
ptr += todo;
|
||||
}
|
||||
ENCODING_CODERANGE_SET(res, rb_usascii_encindex(), ENC_CODERANGE_7BIT);
|
||||
break;
|
||||
|
||||
case 'M': /* quoted-printable encoded string */
|
||||
|
@ -928,6 +929,7 @@ pack_pack(VALUE ary, VALUE fmt)
|
|||
if (len <= 1)
|
||||
len = 72;
|
||||
qpencode(res, from, len);
|
||||
ENCODING_CODERANGE_SET(res, rb_usascii_encindex(), ENC_CODERANGE_7BIT);
|
||||
break;
|
||||
|
||||
case 'P': /* pointer to packed byte string */
|
||||
|
@ -1886,6 +1888,7 @@ pack_unpack(VALUE str, VALUE fmt)
|
|||
}
|
||||
}
|
||||
rb_str_set_len(buf, ptr - RSTRING_PTR(buf));
|
||||
ENCODING_CODERANGE_SET(buf, rb_usascii_encindex(), ENC_CODERANGE_7BIT);
|
||||
UNPACK_PUSH(buf);
|
||||
}
|
||||
break;
|
||||
|
@ -1914,6 +1917,7 @@ pack_unpack(VALUE str, VALUE fmt)
|
|||
s++;
|
||||
}
|
||||
rb_str_set_len(buf, ptr - RSTRING_PTR(buf));
|
||||
ENCODING_CODERANGE_SET(buf, rb_usascii_encindex(), ENC_CODERANGE_7BIT);
|
||||
UNPACK_PUSH(buf);
|
||||
}
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче