fx.io: expand path joining functionality to non-path strings

This commit is contained in:
2026-06-20 15:25:16 +01:00
parent 32d4d0abf2
commit ee11ff240f
10 changed files with 239 additions and 151 deletions
+4 -4
View File
@@ -51,12 +51,12 @@ static const fx_path *directory_get_rel_path(const struct fx_directory_p *dir)
static const char *directory_get_path_cstr(const struct fx_directory_p *dir)
{
return fx_path_ptr(dir->d_path_abs);
return fx_path_get_cstr(dir->d_path_abs);
}
static const char *directory_get_rel_path_cstr(const struct fx_directory_p *dir)
{
return fx_path_ptr(dir->d_path_rel);
return fx_path_get_cstr(dir->d_path_rel);
}
static fx_result directory_delete(
@@ -263,7 +263,7 @@ static fx_result directory_open(
int root_fd = root ? root->d_fd : AT_FDCWD;
const char *path_cstr = fx_path_ptr(path);
const char *path_cstr = fx_path_get_cstr(path);
if (root) {
while (*path_cstr == '/') {
path_cstr++;
@@ -571,7 +571,7 @@ fx_iterator *fx_directory_begin(
int fts_flags = FTS_COMFOLLOW | FTS_NOCHDIR;
const char *path_list[] = {
fx_path_ptr(it->_p->d_path_abs),
fx_path_get_cstr(it->_p->d_path_abs),
NULL,
};