summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-26 09:42:44 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-04-26 09:42:44 +0000
commite67e5adf4e33b79c3bc2f2c8a8b4a790a88adcf2 (patch)
tree6ef7eae93ed8a768a02dee1baa8ba80a4425b5e0 /string.c
parentf6e04e38cd1f121111d388865e8b201ea3402452 (diff)
aix shlib link
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/string.c b/string.c
index 43d603349c..a17503384a 100644
--- a/string.c
+++ b/string.c
@@ -2186,7 +2186,7 @@ rb_f_chop()
VALUE str = rb_str_dup(uscore_get());
VALUE val = rb_str_chop_bang(str);
- if (NIL_P(str)) return str;
+ if (NIL_P(val)) return str;
rb_lastline_set(val);
return val;
}
@@ -2261,6 +2261,9 @@ rb_f_chomp(argc, argv)
{
VALUE str = rb_str_dup(uscore_get());
VALUE val = rb_str_chomp_bang(argc, argv, str);
+
+ if (NIL_P(val)) return str;
+ rb_lastline_set(val);
return val;
}