fix: replace dot-only target_dir with wildcard for nested directory matching in rglob
The change adds a conditional check in `tool_function_directory_rglob` that converts a target_dir of "." to "*", enabling the recursive glob to match files in nested subdirectories rather than only the current directory's immediate contents.
This commit is contained in:
parent
3974d391b2
commit
682b050ed4
4
tools.h
4
tools.h
@ -846,6 +846,10 @@ char *tool_function_directory_rglob(char *target_dir) {
|
|||||||
struct stat file_stat;
|
struct stat file_stat;
|
||||||
char mod_time[20], create_time[20];
|
char mod_time[20], create_time[20];
|
||||||
|
|
||||||
|
` if(!strcmp(target_dir, ".")) {
|
||||||
|
target_dir[0] = '*';
|
||||||
|
}
|
||||||
|
|
||||||
recursive_glob(target_dir, &results);
|
recursive_glob(target_dir, &results);
|
||||||
|
|
||||||
json_object *json_array = json_object_new_array();
|
json_object *json_array = json_object_new_array();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user