summaryrefslogtreecommitdiffstats
path: root/options/path.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-26 19:32:53 +0200
committerwm4 <wm4@nowhere>2014-06-26 19:56:45 +0200
commit3e631b9cb851a1c29880beaded78f2bbfa694976 (patch)
treee31e70674a3ce1955addaf08a10179fde04aecd3 /options/path.c
parent7f55a39646af1696444be2a04dc0d212db3f7013 (diff)
downloadmpv-3e631b9cb851a1c29880beaded78f2bbfa694976.tar.bz2
mpv-3e631b9cb851a1c29880beaded78f2bbfa694976.tar.xz
config: use the same signature for win32/OSX specific path functions
Seems like a good idea, even if it's basically unused (yet). Also document requirements on the functions (they're not obvious). OSX changes untested.
Diffstat (limited to 'options/path.c')
-rw-r--r--options/path.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/options/path.c b/options/path.c
index 69786d8a83..9d32a2ec9b 100644
--- a/options/path.c
+++ b/options/path.c
@@ -44,7 +44,7 @@
#include "osdep/io.h"
#include "osdep/path.h"
-static void mp_add_xdg_config_dirs(struct mpv_global *global, char **dirs, int i)
+static int mp_add_xdg_config_dirs(struct mpv_global *global, char **dirs, int i)
{
void *talloc_ctx = dirs;
@@ -70,7 +70,7 @@ static void mp_add_xdg_config_dirs(struct mpv_global *global, char **dirs, int i
dirs[i++] = old_home;
#if HAVE_COCOA
- dirs[i++] = mp_get_macosx_bundle_dir(talloc_ctx);
+ i = mp_add_macosx_bundle_dir(global, dirs, i);
#endif
tmp = getenv("XDG_CONFIG_DIRS");
@@ -93,10 +93,11 @@ static void mp_add_xdg_config_dirs(struct mpv_global *global, char **dirs, int i
break;
}
}
- }
- else {
+ } else {
dirs[i++] = MPLAYER_CONFDIR;
}
+
+ return i;
}
// Return NULL-terminated array of config directories, from highest to lowest
@@ -123,9 +124,9 @@ static char **mp_config_dirs(void *talloc_ctx, struct mpv_global *global)
ret[i++] = talloc_strdup(ret, tmp);
#if defined(_WIN32) && !defined(__CYGWIN__)
- mp_add_win_config_dirs(global, ret, i);
+ i = mp_add_win_config_dirs(global, ret, i);
#else
- mp_add_xdg_config_dirs(global, ret, i);
+ i = mp_add_xdg_config_dirs(global, ret, i);
#endif
MP_VERBOSE(global, "search dirs:");