summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorcboesch <cboesch@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-12-04 10:24:42 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-12-16 05:27:13 +0200
commit920d0976e7f657b34804b39bfbb4785fd24a76f0 (patch)
treeddcb7bf19966dc8d22bd3c0812f04b98cfd19085 /command.c
parent9e35edf08bcb1b5b5d50a6860d133669fa184673 (diff)
downloadmpv-920d0976e7f657b34804b39bfbb4785fd24a76f0.tar.bz2
mpv-920d0976e7f657b34804b39bfbb4785fd24a76f0.tar.xz
Change some filename-handling code to use mp_basename()
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32675 b3059339-0415-0410-9bf9-f77b7e298cf2
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,