sanebox: avert a subshell in removeSubpaths
This commit is contained in:
@@ -887,7 +887,7 @@ removeSubpaths() {
|
|||||||
for path in "${paths[@]}"; do
|
for path in "${paths[@]}"; do
|
||||||
local isSubpath=
|
local isSubpath=
|
||||||
for other in "${paths[@]}"; do
|
for other in "${paths[@]}"; do
|
||||||
if [[ "$path" =~ ^"$other"/ ]] || ( [ "$other" = / ] && [ "$path" != / ] ); then
|
if [[ "$path" =~ ^"$other"/ ]] || [ "$other" = / -a "$path" != / ]; then
|
||||||
# N.B.: $path lacks a trailing slash, so this never matches self.
|
# N.B.: $path lacks a trailing slash, so this never matches self.
|
||||||
# UNLESS $path or $other is exactly `/`, which we special-case.
|
# UNLESS $path or $other is exactly `/`, which we special-case.
|
||||||
isSubpath=1
|
isSubpath=1
|
||||||
|
Reference in New Issue
Block a user