summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorTakeshi Watanabe <[email protected]>2018-03-24 16:18:44 +0900
committerTakeshi Watanabe <[email protected]>2018-03-24 16:18:44 +0900
commit77a3863a3d4b57fdd29beebb1e56f4874607fe70 (patch)
tree25745eb4d7abd8ba6f8edab99bbed415135ee0b4 /src
parent8e8bc9e40b2054881cde7bb16b29173c9ca6a048 (diff)
downloadmruby-77a3863a3d4b57fdd29beebb1e56f4874607fe70.tar.gz
mruby-77a3863a3d4b57fdd29beebb1e56f4874607fe70.zip
Return nil if type differ in `String#<=>`.
Diffstat (limited to 'src')
-rw-r--r--src/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index e8c60a660..469335bb9 100644
--- a/src/string.c
+++ b/src/string.c
@@ -926,7 +926,7 @@ mrb_str_cmp_m(mrb_state *mrb, mrb_value str1)
else {
mrb_value tmp = mrb_funcall(mrb, str2, "<=>", 1, str1);
- if (!mrb_nil_p(tmp)) return mrb_nil_value();
+ if (mrb_nil_p(tmp)) return mrb_nil_value();
if (!mrb_fixnum_p(tmp)) {
return mrb_funcall(mrb, mrb_fixnum_value(0), "-", 1, tmp);
}