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:
retoor 2025-04-07 08:24:11 +00:00
parent 3974d391b2
commit 682b050ed4

View File

@ -846,6 +846,10 @@ char *tool_function_directory_rglob(char *target_dir) {
struct stat file_stat;
char mod_time[20], create_time[20];
` if(!strcmp(target_dir, ".")) {
target_dir[0] = '*';
}
recursive_glob(target_dir, &results);
json_object *json_array = json_object_new_array();