summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--io.c6
-rw-r--r--string.c2
3 files changed, 19 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 4cfa151a5..39befdccb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@ Thu Nov 25 10:14:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* dir.c (push_braces): do not reuse buffer strings. [ruby-core:03806]
+Thu Nov 25 07:59:41 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * io.c (read_all): [ruby-dev:24955]
+
Wed Nov 24 01:01:31 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* io.c (io_read): [ruby-dev:24952]
@@ -706,6 +710,16 @@ Mon Oct 18 15:58:01 2004 NAKAMURA Usaku <usa@ruby-lang.org>
* range.c (range_step, range_each): need cast.
+Fri Oct 29 16:34:19 2004 Daiki Ueno <ueno@unixuser.org>
+
+ * misc/ruby-mode.el (ruby-parse-partial): Parse the rest of the
+ line after opening heredoc identifier. [ruby-dev:24635]
+
+Fri Oct 29 16:34:19 2004 Daiki Ueno <ueno@unixuser.org>
+
+ * misc/ruby-mode.el (ruby-parse-partial): Parse the rest of the
+ line after opening heredoc identifier. [ruby-dev:24635]
+
Mon Oct 18 07:26:21 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* file.c (rb_file_truncate): discard read buffer before truncation.
diff --git a/io.c b/io.c
index 4ac42dabb..ec37d03c0 100644
--- a/io.c
+++ b/io.c
@@ -1010,9 +1010,10 @@ read_all(fptr, siz, str)
if (siz == 0) siz = BUFSIZ;
if (NIL_P(str)) {
- str = rb_tainted_str_new(0, siz);
+ str = rb_str_new(0, siz);
}
else {
+ StringValue(str);
rb_str_resize(str, siz);
}
for (;;) {
@@ -1033,6 +1034,7 @@ read_all(fptr, siz, str)
rb_str_resize(str, siz);
}
if (bytes != siz) rb_str_resize(str, bytes);
+ OBJ_TAINT(str);
return str;
}
@@ -1074,7 +1076,7 @@ io_read(argc, argv, io)
}
if (NIL_P(str)) {
- str = rb_str_new(0, len);
+ str = rb_tainted_str_new(0, len);
}
else {
StringValue(str);
diff --git a/string.c b/string.c
index 8615bf5a5..7416561e2 100644
--- a/string.c
+++ b/string.c
@@ -676,8 +676,8 @@ rb_str_resize(str, len)
rb_raise(rb_eArgError, "negative string size (or size too big)");
}
+ rb_str_modify(str);
if (len != RSTRING(str)->len) {
- rb_str_modify(str);
if (RSTRING(str)->len < len || RSTRING(str)->len - len > 1024) {
REALLOC_N(RSTRING(str)->ptr, char, len+1);
if (!FL_TEST(str, STR_NOCAPA)) {