fix function
This commit is contained in:
1 parent
1c5ed86fa3
commit
b21512d5ea
1 file changed
+4
-2
+4
-2
@@ -151,7 +151,7 @@ arDdnsCheck() {
|
|||||||
# See: http://stackoverflow.com/a/29835459/4449544
|
# See: http://stackoverflow.com/a/29835459/4449544
|
||||||
# Execute the function in a *subshell* to localize variables and the effect of `cd`.
|
# Execute the function in a *subshell* to localize variables and the effect of `cd`.
|
||||||
|
|
||||||
rreadlink() (
|
rreadlink() {
|
||||||
|
|
||||||
target=$1 fname= targetDir= CDPATH=
|
target=$1 fname= targetDir= CDPATH=
|
||||||
|
|
||||||
@@ -174,6 +174,7 @@ rreadlink() (
|
|||||||
fi
|
fi
|
||||||
break # Ultimate target reached.
|
break # Ultimate target reached.
|
||||||
done
|
done
|
||||||
|
|
||||||
targetDir=$(command pwd -P) # Get canonical dir. path
|
targetDir=$(command pwd -P) # Get canonical dir. path
|
||||||
# Output the ultimate target's canonical path.
|
# Output the ultimate target's canonical path.
|
||||||
# Note that we manually resolve paths ending in /. and /.. to make sure we have a normalized path.
|
# Note that we manually resolve paths ending in /. and /.. to make sure we have a normalized path.
|
||||||
@@ -186,7 +187,8 @@ rreadlink() (
|
|||||||
else
|
else
|
||||||
command printf '%s\n' "${targetDir%/}/$fname"
|
command printf '%s\n' "${targetDir%/}/$fname"
|
||||||
fi
|
fi
|
||||||
)
|
|
||||||
|
}
|
||||||
|
|
||||||
# Load config file
|
# Load config file
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user