diff options
Diffstat (limited to 'path.c')
-rw-r--r-- | path.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -193,3 +193,19 @@ void set_codec_path(const char *path) strcpy(codec_path, path); needs_free = 1; } + +const char *mp_basename(const char *path) +{ + char *s; + +#if HAVE_DOS_PATHS + s = strrchr(path, '\\'); + if (s) + path = s + 1; + s = strrchr(path, ':'); + if (s) + path = s + 1; +#endif + s = strrchr(path, '/'); + return s ? s + 1 : path; +} |