From fcec3df700386139c1fcd11bdd7c501ce26b6913 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 15 Dec 2014 06:24:05 +0100 Subject: scripting: fix/improve deprecation message The message was missing a '\n', so it was merged with the next line, which also typically caused it not to be printed with the colors for warnings. Print the full new path in the warning message. (Normally, cfg should never be NULL, so accounting for this case is just for robustness.) --- player/scripting.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/player/scripting.c b/player/scripting.c index 2ad45075b0..d8fbb6f84e 100644 --- a/player/scripting.c +++ b/player/scripting.c @@ -198,9 +198,12 @@ void mp_load_scripts(struct MPContext *mpctx) for (int n = 0; files && files[n]; n++) { if (s && !warning_displayed) { warning_displayed = 1; - MP_WARN(mpctx, - "warning: '%s' - '%s' dirs are deprecated. Please move scripts to '%s'.", - files[n], dirs[s], dirs[0]); + char *cfg = mp_find_config_file(tmp, mpctx->global, ""); + if (cfg) + cfg = mp_path_join(tmp, bstr0(cfg), bstr0("scripts")); + MP_WARN(mpctx, "Warning: '%s' - lua subdir is deprecated.\n" + "Please move scripts to '%s'.\n", + files[n], cfg ? cfg : "/scripts"); } mp_load_script(mpctx, files[n]); } -- cgit v1.2.3