aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-01-09 18:30:05 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-01-09 21:44:15 +0900
commit0d7bbfc9415aa066ea8c17b90dd06c5d47fed50b (patch)
treea99778df04211c1d8b698bc4b28f98d92a200488 /lib/mkmf.rb
parent0a2bf5f1e256de7f030668c6130379cbd0d6d708 (diff)
downloadruby-0d7bbfc9415aa066ea8c17b90dd06c5d47fed50b.tar.gz
mkmf.rb: Prefer `caller_locations` over parsing `caller`
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index e4a6fc984f..791838308c 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -971,7 +971,11 @@ SRC
# Internal use only.
#
def checking_for(m, fmt = nil)
- f = caller[0][/in `([^<].*)'$/, 1] and f << ": " #` for vim #'
+ if f = caller_locations(1, 1).first.base_label and /\A\w/ =~ f
+ f += ": "
+ else
+ f = ""
+ end
m = "checking #{/\Acheck/ =~ f ? '' : 'for '}#{m}... "
message "%s", m
a = r = nil