0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00
mpv/options
wm4 31acec5438 path: change win32 semantics for joining drive-relative paths
win32 is a cursed abomination which has "drive letters" at the root of
the filesystem namespace for no reason. This requires special handling
beyond tolerating the idiotic "\" path separator.

Even more cursed is the fact that a path starting with a drive letter
can be a relative path. For example, "c:billsucks" is actually a
relative path to the current working directory of the C drive. So for
example if the current working directory is "c:/windowsphone", then
"c:billsucks" would reference "c:/windowsphone/billsucks".

You should realize that win32 is a ridiculous satanic trash fire by the
point you realize that win32 has at least 26 current working
directories, one for each drive letter.

Anyway, the actual problem is that mpv's mp_path_join() function would
return a relative path if an absolute relative path is joined with a
drive-relative path. This should never happen; I bet it breaks a lot of
assumptions (maybe even some security or safety relevant ones, but
probably not).

Since relative drive paths are such a fucked up shit idea, don't try to
support them "properly", and just solve the problem at hand. The
solution produces a path that should be invalid on win32.

Joining two relative paths still behaves the same; this is probably OK
(maybe).

The change isn't very minimal due to me rewriting parts of it without
strict need, but I don't care.

Note that the Python os.path.join() function (after which the mpv
function was apparently modeled) has the same problem.
2020-02-06 14:10:40 +01:00
..
m_config.c options: stop hiding deprecated options 2020-02-04 20:10:38 +01:00
m_config.h options: stop hiding deprecated options 2020-02-04 20:10:38 +01:00
m_option.c m_option: fix runtime changing of --audio-channels 2019-12-27 17:44:33 +01:00
m_option.h options: remove unused set_defaults callback 2020-02-01 16:00:44 +01:00
m_property.c command: move property multiply code to m_property.c 2018-03-26 19:47:08 +02:00
m_property.h command: move property multiply code to m_property.c 2018-03-26 19:47:08 +02:00
options.c Revert "options: move cursor autohiding opts to mp_vo_opts" 2020-01-12 01:54:41 +00:00
options.h Revert "options: move cursor autohiding opts to mp_vo_opts" 2020-01-12 01:54:41 +00:00
parse_commandline.c options: merge split_opt functions 2020-01-29 23:20:04 +01:00
parse_commandline.h player: get rid of mpv_global.opts 2018-05-24 19:56:35 +02:00
parse_configfile.c options: change license of most files to LGPL (except options.c/.h) 2017-06-12 20:55:17 +02:00
parse_configfile.h options: change license of most files to LGPL (except options.c/.h) 2017-06-12 20:55:17 +02:00
path.c path: change win32 semantics for joining drive-relative paths 2020-02-06 14:10:40 +01:00
path.h path: don't access global option struct 2018-05-24 19:56:35 +02:00