summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-09 15:26:47 +0200
committerwm4 <wm4@nowhere>2015-05-09 15:26:47 +0200
commit04c02796bd371e65f81a92b853658b8fbadb7ad5 (patch)
tree75b09115e17eedbf06cb3233eb145a5c19f72b58 /player
parent40997b8ae5b4065b3e71d4369eaba14c991e5027 (diff)
downloadmpv-04c02796bd371e65f81a92b853658b8fbadb7ad5.tar.bz2
mpv-04c02796bd371e65f81a92b853658b8fbadb7ad5.tar.xz
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().
Diffstat (limited to 'player')
-rw-r--r--player/configfiles.c4
-rw-r--r--player/lua.c4
-rw-r--r--player/screenshot.c2
-rw-r--r--player/scripting.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/player/configfiles.c b/player/configfiles.c
index 52cd837ab7..984a0fd02e 100644
--- a/player/configfiles.c
+++ b/player/configfiles.c
@@ -117,7 +117,7 @@ static void mp_load_per_file_config(struct MPContext *mpctx)
char *name = mp_basename(cfg);
bstr dir = mp_dirname(cfg);
- char *dircfg = mp_path_join(NULL, dir, bstr0("mpv.conf"));
+ char *dircfg = mp_path_join_bstr(NULL, dir, bstr0("mpv.conf"));
try_load_config(mpctx, dircfg, FILE_LOCAL_FLAGS);
talloc_free(dircfg);
@@ -181,7 +181,7 @@ static char *mp_get_playback_resume_config_filename(struct mpv_global *global,
char *cwd = mp_getcwd(tmp);
if (!cwd)
goto exit;
- realpath = mp_path_join(tmp, bstr0(cwd), bstr0(fname));
+ realpath = mp_path_join(tmp, cwd, fname);
}
}
if (bstr_startswith0(bfname, "dvd://"))
diff --git a/player/lua.c b/player/lua.c
index 8cfcd059a4..2e00f79dda 100644
--- a/player/lua.c
+++ b/player/lua.c
@@ -280,7 +280,7 @@ static void set_path(lua_State *L)
char **luadir = mp_find_all_config_files(tmp, get_mpctx(L)->global, "scripts");
for (int i = 0; luadir && luadir[i]; i++) {
newpath = talloc_asprintf_append(newpath, ";%s",
- mp_path_join(tmp, bstr0(luadir[i]), bstr0("?.lua")));
+ mp_path_join(tmp, luadir[i], "?.lua"));
}
lua_pushstring(L, newpath); // package path newpath
@@ -1142,7 +1142,7 @@ static int script_join_path(lua_State *L)
{
const char *p1 = luaL_checkstring(L, 1);
const char *p2 = luaL_checkstring(L, 2);
- char *r = mp_path_join(NULL, bstr0(p1), bstr0(p2));
+ char *r = mp_path_join(NULL, p1, p2);
lua_pushstring(L, r);
talloc_free(r);
return 1;
diff --git a/player/screenshot.c b/player/screenshot.c
index 0449dfb5a1..f30ccf9581 100644
--- a/player/screenshot.c
+++ b/player/screenshot.c
@@ -284,7 +284,7 @@ static char *gen_fname(screenshot_ctx *ctx, const char *file_ext)
if (dir && dir[0]) {
void *t = fname;
dir = mp_get_user_path(t, ctx->mpctx->global, dir);
- fname = mp_path_join(NULL, bstr0(dir), bstr0(fname));
+ fname = mp_path_join(NULL, dir, fname);
talloc_free(t);
mp_mkdirp(dir);
diff --git a/player/scripting.c b/player/scripting.c
index eafe568c56..3ae97193ba 100644
--- a/player/scripting.c
+++ b/player/scripting.c
@@ -163,7 +163,7 @@ static char **list_script_files(void *talloc_ctx, char *path)
return NULL;
struct dirent *ep;
while ((ep = readdir(dp))) {
- char *fname = mp_path_join(talloc_ctx, bstr0(path), bstr0(ep->d_name));
+ char *fname = mp_path_join(talloc_ctx, path, ep->d_name);
struct stat s;
if (!stat(fname, &s) && S_ISREG(s.st_mode))
MP_TARRAY_APPEND(talloc_ctx, files, count, fname);