diff options
Diffstat (limited to 'mpvcore/path.c')
-rw-r--r-- | mpvcore/path.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mpvcore/path.c b/mpvcore/path.c index 647693fb05..93e2d09b04 100644 --- a/mpvcore/path.c +++ b/mpvcore/path.c @@ -202,3 +202,15 @@ bool mp_is_url(bstr path) } return true; } + +void mp_mk_config_dir(char *subdir) +{ + void *tmp = talloc_new(NULL); + char *confdir = talloc_steal(tmp, mp_find_user_config_file("")); + if (confdir) { + if (subdir) + confdir = mp_path_join(tmp, bstr0(confdir), bstr0(subdir)); + mkdir(confdir, 0777); + } + talloc_free(tmp); +} |