From dc26f877b7f3f398c37b76f10637513712330008 Mon Sep 17 00:00:00 2001 From: Thomas Levine <_@thomaslevine.com> Date: Sun, 6 Mar 2016 10:22:15 +0000 Subject: [PATCH] fix file discovery --- urchin | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/urchin b/urchin index 23d1409..b327aa5 100755 --- a/urchin +++ b/urchin @@ -134,12 +134,16 @@ recurse() { fi done - echo "${requested_path}" | grep "^${potential_test}" > /dev/null || - echo "${potential_test}" | grep "^${requested_path}" > /dev/null || - { test "${potential_test}" != "${requested_test}" && - test -f "${potential_test}" && test -f "${requested_path}"; } || + if echo "${requested_path}" | grep "^${potential_test}" > /dev/null || + echo "${potential_test}" | grep "^${requested_path}" > /dev/null; then + if test "$(dirname "${potential_test}")" = \ + "$(dirname "${requested_path}")" && + test "${potential_test}" != "${requested_path}"; then + return 0 + fi + else return 0 - echo "${requested_path}" XXX "${potential_test}" + fi validate_strings "${potential_test}" 'Test file names'