diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-04 07:34:19 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-04 07:34:19 +0000 |
commit | 31230ec3de8249cb2a0d1fb11ae87853b2d2edd4 (patch) | |
tree | a65171fc36999a1cc3c537a0b8bf62ddd9b16f77 /string.c | |
parent | 1258af1e28d321ce14e1ba5e342ccc279e081f18 (diff) | |
download | ruby-31230ec3de8249cb2a0d1fb11ae87853b2d2edd4.tar.gz ruby-31230ec3de8249cb2a0d1fb11ae87853b2d2edd4.tar.xz ruby-31230ec3de8249cb2a0d1fb11ae87853b2d2edd4.zip |
* string.c (rb_str_aset): should raise error if an indexing string
is not found in the receiver.
* sprintf.c (rb_f_sprintf): "%d" should convert objects into
integers using Integer().
* lib/tempfile.rb (Tempfile::size): added.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -1307,9 +1307,10 @@ rb_str_aset(str, indx, val) case T_STRING: beg = rb_str_index(str, indx, 0); - if (beg != -1) { - rb_str_update(str, beg, RSTRING(indx)->len, val); + if (beg < 0) { + rb_raise(rb_eIndexError, "string not matched"); } + rb_str_update(str, beg, RSTRING(indx)->len, val); return val; default: |