From 8d53676743c526e89d708090b4151ba079a2c6e5 Mon Sep 17 00:00:00 2001 From: David Jones Date: Fri, 26 Jul 2013 12:51:01 +0100 Subject: [PATCH] Ensure we can cd into directories starting with a hyphen. Fixes #3. --- tests/- directories starting with a hypen.../Should work | 2 ++ urchin | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100755 tests/- directories starting with a hypen.../Should work diff --git a/tests/- directories starting with a hypen.../Should work b/tests/- directories starting with a hypen.../Should work new file mode 100755 index 0000000..039e4d0 --- /dev/null +++ b/tests/- directories starting with a hypen.../Should work @@ -0,0 +1,2 @@ +#!/bin/sh +exit 0 diff --git a/urchin b/urchin index 1db42c3..8ac2251 100755 --- a/urchin +++ b/urchin @@ -2,7 +2,7 @@ fullpath() { ( - cd "$1" + cd -- "$1" pwd ) } @@ -28,7 +28,7 @@ recurse() { ( indent $indent_level echo " ${potential_test}" - cd "$potential_test" + cd -- "$potential_test" [ -f setup_dir ] && [ -x setup_dir ] && ./setup_dir >> "$stdout_file" for test in * do