summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2024-02-15 10:56:29 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2024-03-14 18:33:28 +0900
commit5326337d4f15ccf33128b3cf5a8896ba7f91fcc4 (patch)
tree3ad7ae3a09b634a82be39e42fda926df3ed5035a /dir.c
parent67fe047821d08781f783476c4060f017cd27541f (diff)
[Feature #20244] Issue a single `Warning.warn` call
Make the entire series of message lines a multiline string so that the `Warning.warn` hook can receive them in a single call.
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/dir.c b/dir.c
index da23c383cb..84ef5ee6f5 100644
--- a/dir.c
+++ b/dir.c
@@ -1082,9 +1082,13 @@ chdir_alone_block_p(void)
if (rb_thread_current() != chdir_lock.thread)
rb_raise(rb_eRuntimeError, "conflicting chdir during another chdir block");
if (!block_given) {
- rb_warn("conflicting chdir during another chdir block");
if (!NIL_P(chdir_lock.path)) {
- rb_compile_warn(RSTRING_PTR(chdir_lock.path), chdir_lock.line, "here");
+ rb_warn("conflicting chdir during another chdir block\n"
+ "%" PRIsVALUE ":%d: note: previous chdir was here",
+ chdir_lock.path, chdir_lock.line);
+ }
+ else {
+ rb_warn("conflicting chdir during another chdir block");
}
}
}