mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 01:17:45 +00:00
f053cd27c6
Glob ordering is used in a variety of places, including figuring out conf.d and really needs to be stable. Other ordering, like completions, is really just cosmetic and can change if it makes for a nicer experience. So we uncouple it by copying the wcsfilecmp from 3.0.2, which will return the ordering to what it was in that release. Fixes #6593
32 lines
1.1 KiB
Fish
32 lines
1.1 KiB
Fish
# 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.
|
|
set -l oldpwd (pwd)
|
|
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
|
|
|
|
cd $oldpwd
|
|
rm -Rf $dir
|
|
|
|
|
|
# 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
|
|
# "__env.fish" here to confirm ordering - #6593.
|
|
touch $where/alpha.txt $where/beta.txt $where/delta.txt $where/__env.fish
|
|
echo $where/*
|
|
#CHECK: ../test/temp/fish_wildcard_permissions_test/noaccess/yesaccess/__env.fish ../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
|