Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
libpkg: Make the RELATIVE_PATH macro more robust
Mark Johnston committed 7 months ago
commit 52913da79460ddb0fa4d2c948c2a525f5974f95a
parent 91abcd0
1 file changed +1 -1
modified libpkg/private/utils.h
@@ -19,7 +19,7 @@
#include <xstring.h>

#define STARTS_WITH(string, needle) (strncasecmp(string, needle, strlen(needle)) == 0)
-
#define RELATIVE_PATH(p) (p + (*p == '/' ? 1 : 0))
+
#define RELATIVE_PATH(p) (&p[strspn(p, "/")])

#define ERROR_SQLITE(db, query) do { \
	pkg_emit_error("sqlite error while executing %s in file %s:%d: %s", query, \