<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/tests/ls, branch next</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=next</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=next'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2009-09-30T14:42:35Z</updated>
<entry>
<title>ls: always print "?" for allocated size of a dereferenced dangling symlink</title>
<updated>2009-09-30T14:42:35Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2009-09-29T14:43:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=d4c7114bce116aefe28c899f5d0e7dcc39feb103'/>
<id>urn:sha1:d4c7114bce116aefe28c899f5d0e7dcc39feb103</id>
<content type='text'>
Previously for `ls -Ls` (but not `ls -Lsl`), we referenced
the st_blocks returned from the previous failed stat() call.
This undefined value was seen to be 0 for dangling symlinks at least.
* src/ls.c (print_file_name_and_frills, length_of_file_name_and_frills):
Don't use st_blocks if the previous stat() failed
* tests/ls/dangle: Add a test case
* NEWS: Mention the fix, and roll up related items into a single entry.
</content>
</entry>
<entry>
<title>ls: print "?", not "0" as inode of dereferenced dangling symlink</title>
<updated>2009-09-29T09:42:45Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-09-28T18:24:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=36edf7bad2ab76720a0bf6519074d23d4b8823a7'/>
<id>urn:sha1:36edf7bad2ab76720a0bf6519074d23d4b8823a7</id>
<content type='text'>
ls prints inode numbers two ways: for long (-l) listings,
and for short ones, e.g., ls -li and ls -i.  The code to print
long listings properly printed "?" when the inode was unknown,
but the code for handling short listings would print 0 instead.
Factor out the formatting code into a new function so ls prints
the right string ("?") from both places:
* NEWS (Bug fixes): Mention it.
* src/ls.c (format_inode): New function.
(print_long_format): Use it here.
(print_file_name_and_frills): Use it here, too.
* tests/ls/dangle: Exercise this fix.
Reported by Yang Ren in http://bugzilla.redhat.com/525400
</content>
</entry>
<entry>
<title>ls: with -LR, exit with status 2 upon detecting a cycle</title>
<updated>2009-09-29T05:28:39Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-09-28T16:29:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=242689c7f93de72693979f877dd31b3ef7178eea'/>
<id>urn:sha1:242689c7f93de72693979f877dd31b3ef7178eea</id>
<content type='text'>
* src/ls.c (print_dir): Diagnosing the cycle is not enough.
Also set exit status to 2.  This is what Solaris' /bin/ls does, too.
* tests/ls/infloop: Rework test: match both expected stdout and stderr.
Require an exit status of 2 in this case.
* doc/coreutils.texi (ls invocation): Mention that a loop provokes
in an exit status of 2.
* NEWS (Bug fixes): Mention it.
Reported by Yang Ren in http://bugzilla.redhat.com/525402.
* THANKS: Correct ordering of Yang Ren's names.
</content>
</entry>
<entry>
<title>ls: handle disabling of colors consistently for all tile types</title>
<updated>2009-09-21T12:16:44Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2009-09-14T12:37:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=3a169f4c5d9159283548178668d2fae6fced3030'/>
<id>urn:sha1:3a169f4c5d9159283548178668d2fae6fced3030</id>
<content type='text'>
* src/ls.c (print_color_indicator): Use consistent syntax for
all file and directory subtypes, and fall back to the color
of the base type if there is no enabled color for the subtype.
This allows turning off specific colors for o+w dirs for example.
* tests/ls/color-dtype-dir: Add a case to test that turning off
coloring for o+w directories, falls back to standard dir color.
* NEWS: Mention the fix
Introduced by commit ac467814, 2005-09-05,
"Colorize set-user-ID ... files and sticky ... directories."
</content>
</entry>
<entry>
<title>tests: ls/color-clear-to-eol: append NL to accommodate old sed</title>
<updated>2009-09-07T17:36:37Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-09-07T17:36:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=9547a78bda1d4f01a782c869be248b5e0faf31f9'/>
<id>urn:sha1:9547a78bda1d4f01a782c869be248b5e0faf31f9</id>
<content type='text'>
* tests/ls/color-clear-to-eol: Some vendor sed programs fail
to operate on lines that are not NL-terminated.
This affects at least Solaris 10's /bin/sed.
Reported by Pádraig Brady.
</content>
</entry>
<entry>
<title>tests: ls/stat-vs-dirent: avoid spurious test failure</title>
<updated>2009-09-05T17:06:31Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-09-05T17:06:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=c392c4b8ef5de84d67d354bb2ecdd544466c50c8'/>
<id>urn:sha1:c392c4b8ef5de84d67d354bb2ecdd544466c50c8</id>
<content type='text'>
* tests/ls/stat-vs-dirent: Avoid test failure when run from a
directory whose name (or ancestor directory name) starts with ".".
</content>
</entry>
<entry>
<title>ls -i: print consistent inode numbers also for mount points</title>
<updated>2009-09-01T05:07:45Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2008-07-02T16:01:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=a977dbbe78f4dcb64e008f41c8a46c4972af834b'/>
<id>urn:sha1:a977dbbe78f4dcb64e008f41c8a46c4972af834b</id>
<content type='text'>
On most unix- and linux-based kernels, ls -i DIR_CONTAINING_MOUNT_POINT
would print the wrong inode number for any entry that is a mount point.
It would do that by relying on readdir's dirent.d_ino values, while
most readdir implementations return the inode number of the underlying,
inaccessible directory.  Thus, it is not consistent with what you'd
get when applying stat to the same entry.  This bug led to surprising
results like "ls -i" and "ls -i --color" printing different numbers (ls
must usually "stat" a file to colorize its name).  This change makes it
so that on offending systems, ls must stat non-command-line-arguments
for which otherwise it would be able to use "for free" dirent.d_ino
values.  Regardless of this change, ls is already required to stat every
command-line argument.  Note: versions of GNU ls prior to coreutils-6.0
did not perform the invalid optimization, and hence always printed
correct inode numbers.  Thus, for the sake of correctness, ls -i is
forgoing the readdir optimization, for any kernel (including linux!)
with POSIX-nonconforming readdir.  Note that currently, only Cygwin has
been agile enough to conform.

* src/ls.c (RELIABLE_D_INO): Define.
(print_dir): Use it.
For plenty of discussion, see this long thread:
http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14020
This bug was introduced by the 2006-02-26 commit, 33eb3efe:
"In ls, avoid calling stat for --inode (-i), when possible."
* tests/ls/readdir-mountpoint-inode: New test.
* tests/Makefile.am (TESTS): Add it.
* tests/ls/stat-vs-dirent: Don't suppress failure of this test,
now that ls -i is fixed.  Though note that it doesn't test well,
since it compares only the always-stat'd command-line arguments.
* NEWS (Bug fixes): Mention it.
</content>
</entry>
<entry>
<title>global: convert indentation-TABs to spaces</title>
<updated>2009-08-25T07:21:00Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-08-22T16:56:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=5e778f7c8d1ecf3d8f11385db013af2ba026e2a5'/>
<id>urn:sha1:5e778f7c8d1ecf3d8f11385db013af2ba026e2a5</id>
<content type='text'>
Transformed via this shell code:
t=$'\t'
git ls-files \
  | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \
  | grep -vE 'tests/pr/|help2man' \
  | xargs grep -lE "^ *$t" \
  | xargs perl -MText::Tabs -ni -le \
    '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
</content>
</entry>
<entry>
<title>maint: update all Copyright year lists to include 2009</title>
<updated>2009-06-23T20:33:15Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-06-23T20:33:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=2232b4d08fdc8ff3ae8e7aa1fa28c8315c41d9ad'/>
<id>urn:sha1:2232b4d08fdc8ff3ae8e7aa1fa28c8315c41d9ad</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tests: ls --color, permissions override hardlink coloring</title>
<updated>2009-06-11T10:39:24Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2009-06-11T10:34:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=ba1c5239bc4b9719a20cedd35a313fa4237e7151'/>
<id>urn:sha1:ba1c5239bc4b9719a20cedd35a313fa4237e7151</id>
<content type='text'>
* tests/ls/multihardlink: Add a test case to demonstrate
and test this non obvious behavior.
</content>
</entry>
</feed>
