summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-04-12 07:07:55 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-04-12 07:07:55 +0000
commit1ff52c6a545a70c75da53e8d5c2600e84327c802 (patch)
tree9fdeb6f5c3205ee01615e6c4ed58ffc11d34b87d /tests
parent0dfc08bf3a0ded5f6ec655db0aa7d6f80c5abdee (diff)
downloadcoreutils-1ff52c6a545a70c75da53e8d5c2600e84327c802.tar.xz
Do not assume that 'sed' can handle long, newline-free input.
Evaluate expr once, not $n times.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/du/long-sloop14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/du/long-sloop b/tests/du/long-sloop
index dd6653c50..b05678a05 100755
--- a/tests/du/long-sloop
+++ b/tests/du/long-sloop
@@ -29,9 +29,16 @@ n=400
dir_list=`seq $n`
mkdir $dir_list || framework_failure=1
-for i in $dir_list; do
- ip1=`expr $i + 1`
- ln -s ../$ip1 $i/s || framework_failure=1
+file=1
+i_minus_1=0
+for i in $dir_list `expr $n + 1`; do
+ case $i_minus_1 in
+ 0) ;;
+ *)
+ ln -s ../$i $i_minus_1/s || framework_failure=1
+ file=$file/s;;
+ esac
+ i_minus_1=$i
done
echo foo > $ip1
@@ -49,7 +56,6 @@ fi
# renders it as `Number of symbolic links encountered during path
# name traversal exceeds MAXSYMLINKS'.
-file=1`printf %${n}s ' '|sed 's, ,/s,g'`
cat $file > /dev/null 2> err && \
{
cat <<EOF >&2