| #autoload |
| |
| # Hack to replace _path_files with one that expands // and then calls the |
| # original. |
| |
| local fdir ffile original found_one |
| |
| # Look for the original _path_files in the $fpath |
| for fdir in $fpath; do |
| ffile=$fdir/$0 |
| if [[ -e $ffile ]]; then |
| if [[ -z $found_one ]]; then |
| found_one=true |
| else |
| original=$ffile |
| break |
| fi |
| fi |
| done |
| |
| if [[ $PREFIX = //* ]]; then |
| # When we get // replace it with $FUCHSIA_DIR. |
| # But shorten $HOME to ~. |
| local short_dir=${FUCHSIA_DIR/${HOME}/\~} |
| PREFIX=${PREFIX/\/\//${short_dir}\/} |
| fi |
| |
| source $original $* |