Fixed bug when one of source file == one of target source file

This commit is contained in:
Kolan Sh 2012-02-25 13:50:33 +04:00
parent de8d1d45ee
commit 6c63a7805c
1 changed files with 5 additions and 1 deletions

View File

@ -167,7 +167,11 @@ while [ $nfiles != $nparsed ]; do
if [ -f "$d/$f.$ext" ]; then
F="$d/$f.$ext"
elif [ -f "$d/`basename $f.$ext`" ]; then
F="$d/`basename $f.$ext`"
let is_tgt=0
for tgt_src in $TARGET_SRC; do
[ "`realpath $d/\`basename $f.$ext\``" == "`realpath $tgt_src`" ] && let is_tgt=1 && break
done
[ 0 -eq $is_tgt ] && F="$d/`basename $f.$ext`"
fi
if [ "$F" != "" ]; then
flist[$nfiles]=$f.$ext