From 682b050ed4069d761762424350269f7912d0f4dc Mon Sep 17 00:00:00 2001 From: retoor Date: Mon, 7 Apr 2025 08:24:11 +0000 Subject: [PATCH] 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. --- tools.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools.h b/tools.h index dfd96be..1267b71 100644 --- a/tools.h +++ b/tools.h @@ -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();