patch 8.1.0220: Ruby converts v:true and v:false to a number
Problem: Ruby converts v:true and v:false to a number.
Solution: Use Qtrue and Qfalse instead. (Masataka Pocke Kuwabara,
closes #3259)
diff --git a/src/if_ruby.c b/src/if_ruby.c
index 4b9af31..2e1f8d7 100644
--- a/src/if_ruby.c
+++ b/src/if_ruby.c
@@ -1085,8 +1085,10 @@
}
else if (tv->v_type == VAR_SPECIAL)
{
- if (tv->vval.v_number <= VVAL_TRUE)
- result = INT2NUM(tv->vval.v_number);
+ if (tv->vval.v_number == VVAL_TRUE)
+ result = Qtrue;
+ else if (tv->vval.v_number == VVAL_FALSE)
+ result = Qfalse;
} /* else return Qnil; */
return result;