io: store current directory iterator filepath as a b_path
This commit is contained in:
@@ -153,8 +153,23 @@ static void cleanup_iterator(struct b_directory_iterator *it)
|
||||
|
||||
static void update_iterator_data(struct b_directory_iterator *it)
|
||||
{
|
||||
if (it->filepath) {
|
||||
b_path_release(B_PATH(it->filepath));
|
||||
it->filepath = NULL;
|
||||
}
|
||||
|
||||
struct iteration_state *state = get_iteration_state(it->_z);
|
||||
it->filename = state->data.cFileName;
|
||||
|
||||
struct b_path *filename = b_path_create_from_cstr(it->filename);
|
||||
|
||||
const struct b_path *parts[] = {
|
||||
state->search_path,
|
||||
filename,
|
||||
};
|
||||
|
||||
it->filepath
|
||||
= b_path_join(parts, sizeof parts / sizeof parts[0]);
|
||||
}
|
||||
|
||||
static bool move_into_directory(struct b_directory_iterator *it, const char *dir_name)
|
||||
|
||||
Reference in New Issue
Block a user