# Locate source file.
# If no parameter is given, locate it in SDIR and return name as SRCN and extension as SRCEXT
# Or a file name can be given and then SDIR, SRCN and SRCEXT are set.
# Locate source file.
# If no parameter is given, locate it in SDIR and return name as SRCN and extension as SRCEXT
# Or a file name can be given and then SDIR, SRCN and SRCEXT are set.
- SRCBASE=$(echo $1 | sed 's/\.\([^.]\+\)//')
- SRCEXT=$(echo $1 | sed 's/.*\.\([^.]\+\)/\1/')
+ SDIR=`dirname "$1"`
+ local S=`basename "$1"`
+ SBASE=$(echo "$S" | sed 's/\.\([^.]\+\)//')
+ SRCEXT=$(echo "$S" | sed '/\./!d; s/.*\.\([^.]\+\)/\1/')
if [ -n "$SRCEXT" ] ; then
# Full name given, so just check the extension and existence
if [ -n "$SRCEXT" ] ; then
# Full name given, so just check the extension and existence
if [ -n "$COMP_EXTRAS" ] ; then
echo "Extras: $COMP_EXTRAS"
for a in $COMP_EXTRAS ; do cp $PDIR/$a $TDIR/ ; done
if [ -n "$COMP_EXTRAS" ] ; then
echo "Extras: $COMP_EXTRAS"
for a in $COMP_EXTRAS ; do cp $PDIR/$a $TDIR/ ; done