diff options
author | irina <irinagomez@us.es> | 2014-11-05 09:50:01 +0000 |
---|---|---|
committer | irina <irinagomez@us.es> | 2014-11-05 09:50:01 +0000 |
commit | ad051ccf60de3307acf954d3b7f5a20bc87d2260 (patch) | |
tree | 639ac6e4e2533f93f70a36947e67b18f41d0bd7b /client | |
parent | a43e90d7eb68758e34f0348f19ffc3ac404dd1d6 (diff) |
ogGetPath: Vuelve a directorio inicial en caso de error.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4428 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'client')
-rwxr-xr-x | client/engine/File.lib | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/client/engine/File.lib b/client/engine/File.lib index e602b64d..a8536ea3 100755 --- a/client/engine/File.lib +++ b/client/engine/File.lib @@ -232,8 +232,11 @@ case $# in return $? ;; esac -# Eliminar caracteres \c / iniciales, finales y duplicados. +# Volver a directorio inicial en caso de error. CURRENTDIR="$PWD" +trap "cd $CURRENTDIR" RETURN + +# Eliminar caracteres \c / iniciales, finales y duplicados. # /* (comentario Doxygen) FILE="$(echo $FILE|sed -e 's/\(\/\)*\1/\//g' -e 's/^\///' -e 's/\/$//')" PREVFILE="" @@ -248,7 +251,6 @@ done # (comentario Doxygen) */ # Muestra el camino Linux, quitando el / inicial duplicado. [ "$FILEPATH" != "/" ] && echo ${FILEPATH#/} -cd $CURRENTDIR } |