void-packages/srcpkgs/lshw/patches/musl-basename.patch

20 lines
515 B
Diff
Raw Normal View History

2015-10-14 10:27:42 +02:00
For musl libc declare a simple, local version of basename(3)
which expects a const char* parameter.
--- src/core/pci.cc 2015-10-14 10:00:49.449367706 +0200
+++ src/core/pci.cc 2015-10-14 10:02:18.567360753 +0200
@@ -12,6 +12,13 @@
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
+#if !defined(__GLIBC__)
+static const char * basename(const char * src)
+{
+ char* slash = strrchr(src, '/');
+ return slash ? slash+1 : src;
+}
+#endif
__ID("@(#) $Id: pci.cc 2496 2012-05-15 08:00:13Z lyonel $");