X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=src%2Fcompat_posix.c;h=e101ff70fa3fdfccab558d1e47e5fc167edf869e;hb=2642af896e0a9f7b3bca63b02833e69b3bfcd82a;hp=1b8f14ae71e73e22793876f495b7931cfacff674;hpb=48e2f01c5653c8f643b2a763e1cfa2efc1eccd60;p=fdkaac.git diff --git a/src/compat_posix.c b/src/compat_posix.c index 1b8f14a..e101ff7 100644 --- a/src/compat_posix.c +++ b/src/compat_posix.c @@ -48,6 +48,16 @@ int aacenc_fprintf(FILE *fp, const char *fmt, ...) return cnt; } +/* + * Different from POSIX basename() when path ends with /. + * Since we use this only for a regular file, the difference doesn't matter. + */ +const char *aacenc_basename(const char *path) +{ + const char *p = strrchr(path, '/'); + return p ? p + 1: path; +} + #ifndef HAVE_ICONV char *aacenc_to_utf8(const char *s) {