From cd5b734cf8a2d7b390fe959be21b54e3c1e329a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 15 Nov 2011 09:56:04 +0100 Subject: easy_e17.sh: fix find_local_path so is not bothered by --- easy_e17.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/easy_e17.sh b/easy_e17.sh index eafcec1..a673b59 100755 --- a/easy_e17.sh +++ b/easy_e17.sh @@ -1002,9 +1002,10 @@ function run_command () function find_local_path () { name=$1 - path=$(find $src_path -maxdepth 5 -type d -name $name | grep -v -E "^${src_path}$" | grep -v -E "$ignore_dirs_re" | \ + re_src_path=$(echo $src_path | sed 's/\//\\\//g') + path=$(find $src_path -maxdepth 5 -type d -name $name | sed -e "s/$re_src_path//" | grep -v -E "^${src_path}$" | grep -v -E "$ignore_dirs_re" | \ while read line; do echo `echo $line | wc -c` $line; done | sort -n | head -n 1 | cut -d " " -f 2) - if [ "$path" ]; then echo "$path"; fi + if [ "$path" ]; then echo "$src_path/$path"; fi } function compile () -- cgit v1.1-2-g2b99