Skip to contentSkip to conversation

unit: use l_basename in test-path

PATCH New James Prestwood 1 participant 1 message Feb 27, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 unit: use l_basename in test-path

This fixes a compiler error on musl

---
 unit/test-path.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
unit/test-path.c +2 -2
index 1f74423..f01fa52 100644
@@ -55,14 +55,14 @@ static void test_path_find(const void *data)
 	static const char *cant_find = "/foo:/bar:/dir:fr";
 	static const char *can_find = "/tmp";
 	char *tmp_path = l_strdup("/tmp/foobarXXXXXX.tmp");
-	char *base;
+	const char *base;
 	char *path;
 	int fd;
 
 	fd = L_TFR(mkostemps(tmp_path, 4, O_CLOEXEC));
 	assert(fd > 0);
 	L_TFR(close(fd));
-	base = basename(tmp_path);
+	base = l_basename(tmp_path);
 
 	assert(l_path_find(base, cant_find, F_OK) == NULL);
 
Signature · 1 line
2.34.1