summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-07-25 15:30:27 +0000
committerJim Meyering <jim@meyering.net>2006-07-25 15:30:27 +0000
commitc04a374bb026e19b2a993681cadae617b918d692 (patch)
tree2ea91d3ef63c72a242e2e704a037aa2d50fa522c /tests
parent5a06d062c78b2f0b755eef9c4ec2faaf385fa6ac (diff)
downloadcoreutils-c04a374bb026e19b2a993681cadae617b918d692.tar.xz
Get --dired offsets right when handling stat-failed entries.
* src/ls.c (print_long_format): Be careful to increment P by the appropriate amount, even when inode_number_width and nlink_width are zero. * tests/ls/stat-failed: Test for the above.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/ls/stat-failed22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ls/stat-failed b/tests/ls/stat-failed
index a7c006609..bf86681ba 100755
--- a/tests/ls/stat-failed
+++ b/tests/ls/stat-failed
@@ -33,4 +33,26 @@ fail=0
ls -Log d > out 2> err
test $? = 1 || fail=1
+cat <<\EOF > exp || fail=1
+total 0
+?--------- ? ? ? d/s
+EOF
+
+cmp out exp || fail=1
+test $fail = 1 && diff out exp 2> /dev/null
+
+# Ensure that the offsets in --dired output are accurate.
+rm -f out exp
+ls --dired -il d > out 2> /dev/null && fail=1
+
+cat <<\EOF > exp || fail=1
+ total 0
+ ? ?--------- ? ? ? ? ? d/s
+//DIRED// 46 49
+//DIRED-OPTIONS// --quoting-style=literal
+EOF
+
+cmp out exp || fail=1
+test $fail = 1 && diff out exp 2> /dev/null
+
(exit $fail); exit $fail