--- orig/libarch/cmd-file-find.c +++ mod/libarch/cmd-file-find.c @@ -169,7 +169,11 @@ invariant (!str_cmp_prefix (tree_root, filedir_path) && (!filedir_path[str_length (tree_root)] || ('/' == filedir_path[str_length (tree_root)]))); - filedir_loc = str_alloc_cat (0, "./", filedir_path + str_length (tree_root) + 1); + if (!filedir_path[str_length (tree_root)]) + filedir_loc = str_save (0, "./"); + else + filedir_loc = str_alloc_cat (0, "./", filedir_path + str_length (tree_root) + 1); + file_tail = file_name_tail (0, filespec); mod_loc = file_name_in_vicinity (0, filedir_loc, file_tail);