From b1feeee1c4ef1771b5b45c8d1a8439838389082f Mon Sep 17 00:00:00 2001 From: Ivan Gotovchits Date: Wed, 10 Oct 2018 14:00:30 -0400 Subject: [PATCH] fixes the --list-recipes option (#888) it was broken since after we enabled absolute path loading --- src/bap_main.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bap_main.ml b/src/bap_main.ml index 449bc8f61..ddf4928bf 100644 --- a/src/bap_main.ml +++ b/src/bap_main.ml @@ -282,11 +282,11 @@ let print_recipes_and_exit () = List.iter recipe_paths ~f:(fun dir -> if Sys.file_exists dir && Sys.is_directory dir - then Array.iter (Sys.readdir dir) ~f:(fun file -> - let file = dir / file in + then Array.iter (Sys.readdir dir) ~f:(fun entry -> + let file = dir / entry in if Filename.check_suffix file ".recipe" then - let name = Filename.chop_suffix file ".recipe" in + let name = Filename.chop_suffix entry ".recipe" in match Recipe.load ~paths:recipe_paths name with | Ok r -> printf "%-32s %s\n" (Filename.basename name)