summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'command.c')
-rw-r--r--command.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/command.c b/command.c
index 798842b9cd..6bf4825848 100644
--- a/command.c
+++ b/command.c
@@ -290,10 +290,8 @@ static int mp_property_filename(m_option_t *prop, int action, void *arg,
char *f;
if (!mpctx->filename)
return M_PROPERTY_UNAVAILABLE;
- if (((f = strrchr(mpctx->filename, '/'))
- || (f = strrchr(mpctx->filename, '\\'))) && f[1])
- f++;
- else
+ f = (char *)mp_basename(mpctx->filename);
+ if (!*f)
f = mpctx->filename;
return m_property_string_ro(prop, action, arg, f);
}
@@ -1523,10 +1521,7 @@ static int mp_property_sub(m_option_t *prop, int action, void *arg,
sub_name = ass_track->name;
#endif
if (sub_name) {
- char *tmp, *tmp2;
- tmp = sub_name;
- if ((tmp2 = strrchr(tmp, '/')))
- tmp = tmp2 + 1;
+ const char *tmp = mp_basename(sub_name);
snprintf(*(char **) arg, 63, "(%d) %s%s",
mpctx->set_of_sub_pos + 1,