Changeset 533 for trunk


Ignore:
Timestamp:
08/21/2011 15:27:25 (9 months ago)
Author:
joshu
Message:

Corrected abspath's behavior to resolve as much of the real path as possible (see #132)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abspath.in

    r521 r533  
    3939    echo "$dir" 
    4040  else 
    41     dir=`cd $(dirname $file) >/dev/null ; echo \$PWD` 
    42     echo "$dir/$(basename "$file")" 
     41    realpath="$file" 
     42    imagpath="" 
     43    while ! [ -d $realpath ]; do 
     44        imagpath="${imagpath}/${realpath##*/}" 
     45        realpath="${realpath%/*}" 
     46    done 
     47    echo "$(abspath $realpath)${imagpath}" 
    4348  fi 
    4449} 
Note: See TracChangeset for help on using the changeset viewer.