2020-01-23 03:46:02 +08:00
|
|
|
# RUN: %fish %s
|
|
|
|
|
|
|
|
# Ensure that, if variable expansion results in multiple strings
|
|
|
|
# and one of them fails a glob, that we don't fail the entire expansion.
|
2020-01-31 00:34:48 +08:00
|
|
|
set -l oldpwd (pwd)
|
2020-01-23 03:46:02 +08:00
|
|
|
set dir (mktemp -d)
|
|
|
|
cd $dir
|
|
|
|
mkdir a
|
|
|
|
mkdir b
|
|
|
|
touch ./b/file.txt
|
|
|
|
|
|
|
|
set dirs ./a ./b
|
|
|
|
echo $dirs/*.txt
|
|
|
|
# CHECK: ./b/file.txt
|
|
|
|
|
2020-01-31 00:34:48 +08:00
|
|
|
cd $oldpwd
|
2020-01-23 03:46:02 +08:00
|
|
|
rm -Rf $dir
|
2020-02-08 17:43:40 +08:00
|
|
|
|
|
|
|
|
|
|
|
# Verify that we can do wildcard expansion when we
|
|
|
|
# don't have read access to some path components
|
|
|
|
# See #2099
|
|
|
|
set -l where ../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess
|
|
|
|
mkdir -p $where
|
|
|
|
chmod 300 (dirname $where) # no read permissions
|
|
|
|
mkdir -p $where
|
|
|
|
touch $where/alpha.txt $where/beta.txt $where/delta.txt
|
|
|
|
echo $where/*
|
|
|
|
#CHECK: ../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess/alpha.txt ../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess/beta.txt ../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess/delta.txt
|
|
|
|
chmod 700 (dirname $where) # so we can delete it
|
|
|
|
rm -rf ../test/temp/fish_wildcard_permissions_test
|