summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-18 09:34:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-04-18 09:34:40 +0000
commit4d1f86a1ffceb3323b4e2fac82dfc40c5a382e9e (patch)
treeab728d5925c7d423c37a45250808a0303754dbe5 /string.c
parenteb3d3dfcc1ad61cb3040acfdf41f71c228b892e4 (diff)
string.c: warn non-nil $;
* string.c (rb_str_split_m): warn use of non-nil $;. * string.c (rb_fs_setter): warn when set to non-nil value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/string.c b/string.c
index 153fcc59b7..386c460740 100644
--- a/string.c
+++ b/string.c
@@ -7793,6 +7793,9 @@ rb_str_split_m(int argc, VALUE *argv, VALUE str)
else if (!(spat = rb_fs_check(spat))) {
rb_raise(rb_eTypeError, "value of $; must be String or Regexp");
}
+ else {
+ rb_warn("$; is set to non-nil value");
+ }
if (split_type != awk) {
if (BUILTIN_TYPE(spat) == T_STRING) {
rb_encoding *enc2 = STR_ENC_GET(spat);
@@ -9918,6 +9921,9 @@ rb_fs_setter(VALUE val, ID id, VALUE *var)
"value of %"PRIsVALUE" must be String or Regexp",
rb_id2str(id));
}
+ if (!NIL_P(val)) {
+ rb_warn("non-nil $; will be deprecated");
+ }
*var = val;
}