halt='use nullptr instead' \
$(_sc_search_regexp)
+sc_prohibit_bare_set:
+ @prohibit='^ *set [`$$]' \
+ in_vc_files='\.sh$$' \
+ halt='use set -- $$args instead of set $$args' \
+ $(_sc_search_regexp)
+
# Don't use "indent-tabs-mode: nil" anymore. No longer needed.
sc_prohibit_emacs__indent_tabs_mode__setting:
@prohibit='^( *[*#] *)?indent-tabs-mode:' \
ln -s dir symlink || framework_failure_
cp -dR symlink/ s || fail=1
-set $(ls -l s)
+set -- $(ls -l s)
# Prior to fileutils-4.0q, the following would have output ...'s -> dir'
# because the trailing slash was removed unconditionally (now you have to
# Check default name sorting works
for def_sort in '' '--sort=name' '-U --sort=name' '-t --sort=name'; do
- set $(ls $def_sort a B c)
+ set -- $(ls $def_sort a B c)
test "$*" = 'B a c' || fail=1
done
# A has ctime more recent than C.
-set $(ls -t -c a c)
+set -- $(ls -t -c a c)
test "$*" = 'a c' || fail=1
-set $(ls -c a c) # Not specified by POSIX
+set -- $(ls -c a c) # Not specified by POSIX
test "$*" = 'a c' || fail=1
# Sleep so long in an attempt to avoid spurious failures
;;
esac
-set $(ls -ut a B c)
+set -- $(ls -ut a B c)
test "$*" = 'c B a' || fail=1
-set $(ls -u a B c) # not specified by POSIX
+set -- $(ls -u a B c) # not specified by POSIX
test "$*" = 'c B a' || fail=1
test $fail = 1 && ls -l --full-time --time=access a B c
-set $(ls -t a B c)
+set -- $(ls -t a B c)
test "$*" = 'a B c' || fail=1
-set $(ls --time=mtime a B c)
+set -- $(ls --time=mtime a B c)
test "$*" = 'a B c' || fail=1
test $fail = 1 && ls -l --full-time a B c
# Now, C should have ctime more recent than A.
-set $(ls -ct a c)
+set -- $(ls -ct a c)
if test "$*" = 'c a'; then
: ok
else
mkdir dir || framework_failure_
ln -s dir symlink || framework_failure_
-set $(ls -l symlink/)
+set -- $(ls -l symlink/)
# Prior to fileutils-4.0k, the following would have output '... symlink -> dir'.
test "$*" = 'total 0' && : || fail=1
old_IFS=$IFS
IFS=':'
- set $colon_tests
+ set -- $colon_tests
IFS=$old_IFS
while :; do
# In OpenBSD's /bin/sh, mknod is a shell built-in.
# Running via "env" ensures we run our program and not the built-in.
env -- $cmd_w_arg --context=$c 2> out && fail=1
- set $cmd_w_arg; cmd=$1
+ set -- $cmd_w_arg; cmd=$1
echo "$cmd: $msg" > exp || framework_failure_
# Some systems fail with ENOTSUP, EINVAL, ENOENT, or even
for cmd in 'mkdir dir' 'mknod b p' 'mkfifo f'; do
$cmd --context="$c" 2> out && fail=1
- set $cmd
+ set -- $cmd
echo "$1: $msg" > exp || framework_failure_
sed -e 's/ Operation not permitted$//' out > k || framework_failure_
for cmd in 'mkdir dir' 'mknod b p' 'mkfifo f'; do
$cmd --context="$c" || { fail=1; continue; }
- set $cmd
+ set -- $cmd
ls -dZ $2 > out || fail=1
test "$(cut -f1 -d' ' out)" = "$c" || { cat out; fail=1; }
done
mv a b "$other_partition_tmpdir" || fail=1
cd "$other_partition_tmpdir"
-set $(ls -Ci f g)
+set -- $(ls -Ci f g)
test $1 = $3 || fail=1
-set $(ls -Ci a/1 b/1)
+set -- $(ls -Ci a/1 b/1)
test $1 = $3 || fail=1
Exit $fail
19 --1:-12 12
NA LAST NA
'
-set $tests
+set -- $tests
# Require that this test be run at 'nice' level 0.
niceness=$(nice)
11 rows_036 30_80
NA LAST NA
'
-set $tests
+set -- $tests
saved_size=$(stty size) && test -n "$saved_size" \
|| skip_ "can't get window size"