mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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.)
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user