diff options
author | wm4 <wm4@nowhere> | 2020-02-06 19:38:22 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-02-06 19:38:22 +0100 |
commit | c58f9a657995b213790204a344d4f5ddcbd1b6c0 (patch) | |
tree | 7b2a377caec61f0dc2023354eed5d654dba70d7d /mpv_talloc.h | |
parent | 2aaf5317200da0b836b1772576a0d8654e5313a7 (diff) | |
download | mpv-c58f9a657995b213790204a344d4f5ddcbd1b6c0.tar.bz2 mpv-c58f9a657995b213790204a344d4f5ddcbd1b6c0.tar.xz |
scripting: give proper name to scripts using a directory
The recently added feature to load scripts from a sub-directory. A
problem was that the script name was still derived from the actual
script source file that was loaded, which was always "main.lua" (or
similar), resulting in "main" as name.
Fix this by using the directory name.
One odd corner case is that you can do "--script=/path/foo////". As by
POSIX semantics, the extra "/" are ignored. However, the newly added
code strips only one separator, so mp_basename() returns "" (as it
should), and the empty name makes mp_new_client() fail in turn. I don't
really care about this, just don't do it. But mp_new_client() failure
was silent (since it normally never happens), so add at least an error
message for that, instead of being entirely silent.
Diffstat (limited to 'mpv_talloc.h')
0 files changed, 0 insertions, 0 deletions