diff options
author | Elliott Hughes <enh@google.com> | 2015-01-18 13:36:31 -0600 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-01-18 13:36:31 -0600 |
commit | e910826c812fcde8d122990a1e43e17f46b6d03f (patch) | |
tree | 799bbbe2a152f9bf2cf212e6c6d81b8d4f004160 /lib | |
parent | 0a4bd4b89f9a17e4ba8c7873d1384fb04f79b14d (diff) | |
download | toybox-e910826c812fcde8d122990a1e43e17f46b6d03f.tar.gz |
fix non-glibc basename(3) usage
I considered a #else on the big #ifdef __GLIBC__ above, but that
seemed harder to follow.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/portability.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/portability.h b/lib/portability.h index f6f76729..bb1f5aee 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -141,6 +141,11 @@ int utimensat(int fd, const char *path, const struct timespec times[2], int flag #endif +#ifndef __GLIBC__ +// POSIX basename. +#include <libgen.h> +#endif + #ifdef __MUSL__ #include <unistd.h> // Without this "rm -r dir" fails with "is directory". |