From 04c02796bd371e65f81a92b853658b8fbadb7ad5 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 9 May 2015 15:26:47 +0200 Subject: path: make mp_path_join accept normal C strings Instead of bstr. Most callers of this function do not need bstr. The bstr version of this function is now mp_path_join_bstr(). --- osdep/path-macosx.m | 4 ++-- osdep/path-win.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'osdep') diff --git a/osdep/path-macosx.m b/osdep/path-macosx.m index 52e2a2c771..f011289e36 100644 --- a/osdep/path-macosx.m +++ b/osdep/path-macosx.m @@ -28,7 +28,7 @@ const char *mp_get_platform_path_osx(void *talloc_ctx, const char *type) [pool release]; return res; } - if (strcmp(type, "desktop") == 0) - return mp_path_join(talloc_ctx, bstr0(getenv("HOME")), bstr0("Desktop")); + if (strcmp(type, "desktop") == 0 && getenv("HOME")) + return mp_path_join(talloc_ctx, getenv("HOME"), "Desktop"); return NULL; } diff --git a/osdep/path-win.c b/osdep/path-win.c index db6698102f..d0c29556d1 100644 --- a/osdep/path-win.c +++ b/osdep/path-win.c @@ -61,7 +61,7 @@ static char *mp_get_win_shell_dir(void *talloc_ctx, int folder) static char *mp_get_win_app_dir(void *talloc_ctx) { char *path = mp_get_win_shell_dir(talloc_ctx, CSIDL_APPDATA); - return path ? mp_path_join(talloc_ctx, bstr0(path), bstr0("mpv")) : NULL; + return path ? mp_path_join(talloc_ctx, path, "mpv") : NULL; } const char *mp_get_platform_path_win(void *talloc_ctx, const char *type) -- cgit v1.2.3