зеркало из https://github.com/github/ruby.git
* sprintf.c (rb_enc_vsprintf): can be used for ASCII compatible
encodings only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6b1bae9641
Коммит
23b4c10dd8
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Jan 13 18:41:19 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* sprintf.c (rb_enc_vsprintf): can be used for ASCII compatible
|
||||||
|
encodings only.
|
||||||
|
|
||||||
Fri Jan 13 18:29:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Jan 13 18:29:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* thread.c (rb_mutex_unlock_th): simplified.
|
* thread.c (rb_mutex_unlock_th): simplified.
|
||||||
|
|
|
@ -1168,7 +1168,13 @@ rb_enc_vsprintf(rb_encoding *enc, const char *fmt, va_list ap)
|
||||||
f._bf._size = 0;
|
f._bf._size = 0;
|
||||||
f._w = 120;
|
f._w = 120;
|
||||||
result = rb_str_buf_new(f._w);
|
result = rb_str_buf_new(f._w);
|
||||||
if (enc) rb_enc_associate(result, enc);
|
if (enc) {
|
||||||
|
if (!rb_enc_asciicompat(enc)) {
|
||||||
|
rb_raise(rb_eArgError, "cannot construct ASCII-incompatible encoding string: %s",
|
||||||
|
rb_enc_name(enc));
|
||||||
|
}
|
||||||
|
rb_enc_associate(result, enc);
|
||||||
|
}
|
||||||
f._bf._base = (unsigned char *)result;
|
f._bf._base = (unsigned char *)result;
|
||||||
f._p = (unsigned char *)RSTRING_PTR(result);
|
f._p = (unsigned char *)RSTRING_PTR(result);
|
||||||
RBASIC(result)->klass = 0;
|
RBASIC(result)->klass = 0;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче