From 3e631b9cb851a1c29880beaded78f2bbfa694976 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 26 Jun 2014 19:32:53 +0200 Subject: 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. --- options/path.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'options/path.c') 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:"); -- cgit v1.2.3