summaryrefslogtreecommitdiffstats
path: root/player/scripting.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-15 06:24:05 +0100
committerwm4 <wm4@nowhere>2014-12-15 06:24:05 +0100
commitfcec3df700386139c1fcd11bdd7c501ce26b6913 (patch)
tree425f19b5be56436838000a3c835bd91573d63033 /player/scripting.c
parent1c2cbeabc270874c8f14e16c8f7a09c1f0a382d9 (diff)
downloadmpv-fcec3df700386139c1fcd11bdd7c501ce26b6913.tar.bz2
mpv-fcec3df700386139c1fcd11bdd7c501ce26b6913.tar.xz
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.)
Diffstat (limited to 'player/scripting.c')
-rw-r--r--player/scripting.c9
1 files 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]);
}