diff options
author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-06 01:58:32 +0000 |
---|---|---|
committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-09-06 01:58:32 +0000 |
commit | 5ef74b512cd7e8878dfadb8cc2cebc45466aeb0a (patch) | |
tree | 7e91fbc1484a047c8f1abdf7e252b48ef6ecc125 | |
parent | 4ebc9ec226d7aa80db5bcb182fcd895212ee2447 (diff) |
* io.c (rb_io_puts): RSTRING(line)->ptr might be NULL.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | io.c | 3 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Fri Sep 6 10:34:32 2002 Minero Aoki <aamine@loveruby.net> + + * io.c (rb_io_puts): RSTRING(line)->ptr might be NULL. + Fri Sep 6 10:26:37 2002 Minero Aoki <aamine@loveruby.net> * parse.y: should not put non-NODE-VALUEs in the semantic stack. @@ -2451,7 +2451,8 @@ rb_io_puts(argc, argv, out) line = rb_obj_as_string(argv[i]); } rb_io_write(out, line); - if (RSTRING(line)->ptr[RSTRING(line)->len-1] != '\n') { + if (RSTRING(line)->len == 0 || + RSTRING(line)->ptr[RSTRING(line)->len-1] != '\n') { rb_io_write(out, rb_default_rs); } } |