summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/stringio/stringio.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 725bebe42f..b8245b8c57 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jun 28 15:00:06 2007 Nobuyoshi Nakada <[email protected]>
+
+ * ext/stringio/stringio.c (strio_getline): local variable to be
+ initialized. [ruby-dev:31077]
+
Thu Jun 28 11:30:39 2007 NAKAMURA Usaku <[email protected]>
* gc.c (rb_obj_id): use SIGNED_VALUE instead of long.
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index 658d923dd6..25c251c4f5 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -769,12 +769,11 @@ static VALUE
strio_getline(int argc, VALUE *argv, struct StringIO *ptr)
{
const char *s, *e, *p;
- long n, limit;
+ long n, limit = 0;
VALUE str;
if (argc == 0) {
str = rb_rs;
- limit = 0;
}
else {
VALUE lim, tmp;
@@ -790,7 +789,6 @@ strio_getline(int argc, VALUE *argv, struct StringIO *ptr)
}
else {
str = tmp;
- limit = 0;
}
}
else {