rename basename() -> aacenc_basename() and move to compat layer
[fdkaac.git] / src / compat_posix.c
index 1b8f14ae71e73e22793876f495b7931cfacff674..e101ff70fa3fdfccab558d1e47e5fc167edf869e 100644 (file)
@@ -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)
 {
This page took 0.009362 seconds and 4 git commands to generate.