X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=src%2Fcompat_posix.c;h=e101ff70fa3fdfccab558d1e47e5fc167edf869e;hb=5888fddccf0882e7738df13a918f296522034a77;hp=1b8f14ae71e73e22793876f495b7931cfacff674;hpb=c5c459082afba4fe4350851c7ac3774f80c0ee56;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) {