void-packages/srcpkgs/lshw/patches/musl-basename.patch
Jürgen Buchmüller 7a3a434eb1 lshw: unbreak musl
2015-10-14 10:27:58 +02:00

19 lines
515 B
Diff

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 $");