<feed xmlns='http://www.w3.org/2005/Atom'>
<title>coreutils/src/ls.c, branch v8.4</title>
<subtitle>Mirror of https://https.git.savannah.gnu.org/git/coreutils.git/
</subtitle>
<id>https://git.shady.money/coreutils/atom?h=v8.4</id>
<link rel='self' href='https://git.shady.money/coreutils/atom?h=v8.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/'/>
<updated>2010-01-12T05:31:20Z</updated>
<entry>
<title>ls: reorder includes to work around broken &lt;sys/capability.h&gt;</title>
<updated>2010-01-12T05:31:20Z</updated>
<author>
<name>Kamil Dudka</name>
<email>kdudka@redhat.com</email>
</author>
<published>2010-01-09T20:18:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=6454dd0f2f792850453379ba081ca74eed15c2d9'/>
<id>urn:sha1:6454dd0f2f792850453379ba081ca74eed15c2d9</id>
<content type='text'>
* src/ls.c: Include &lt;sys/capability.h&gt; later, to avoid build
failure with a header from libcap-2.16-1 or earlier.
See http://bugzilla.redhat.com/483548 for details.
</content>
</entry>
<entry>
<title>ls: fix color of broken symlinks colored as target</title>
<updated>2010-01-01T20:41:46Z</updated>
<author>
<name>Eric Blake</name>
<email>ebb9@byu.net</email>
</author>
<published>2010-01-01T14:39:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=b7f2b51c42edabd516c5ecc748a654da736c912c'/>
<id>urn:sha1:b7f2b51c42edabd516c5ecc748a654da736c912c</id>
<content type='text'>
* src/ls.c (print_color_indicator): When using 'LINK target' in
dircolors, treat broken symlink as C_ORPHAN.
* tests/misc/ls-misc (sl-dangle2, sl-dangle3, sl-dangle4)
(sl-dangle5): Test for it, and add more coverage.
* NEWS: Document it.
* THANKS: Update.
Reported by Chris Jones.
</content>
</entry>
<entry>
<title>maint: update all FSF copyright year lists to include 2010</title>
<updated>2010-01-01T13:06:47Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2010-01-01T09:56:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=1aa17dc89b3f313697661541adca0aa0defbdc09'/>
<id>urn:sha1:1aa17dc89b3f313697661541adca0aa0defbdc09</id>
<content type='text'>
Use this command:
git ls-files | grep -v COPYING \
  | xargs env UPDATE_COPYRIGHT_USE_INTERVALS=1 \
      build-aux/update-copyright
</content>
</entry>
<entry>
<title>doc: enhance and reference info about version comparison</title>
<updated>2009-12-19T01:21:28Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2009-12-17T10:48:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=3593cf50b224f35d502c36181f94cd5ece257342'/>
<id>urn:sha1:3593cf50b224f35d502c36181f94cd5ece257342</id>
<content type='text'>
* doc/coreutils.texi (sort invocation): Reference the additional
info about filevercmp rather than the unused strverscmp.
(Details about version sort): Add some examples that are not
handled well by fileversmp.
* src/ls.c: Change a comment referencing the now unused strverscmp.
</content>
</entry>
<entry>
<title>ls: fix capability coloring</title>
<updated>2009-11-09T08:16:20Z</updated>
<author>
<name>Pádraig Brady</name>
<email>P@draigBrady.com</email>
</author>
<published>2009-11-08T03:45:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=10d97b31910b0030f7716474a48b3fc8e00dd216'/>
<id>urn:sha1:10d97b31910b0030f7716474a48b3fc8e00dd216</id>
<content type='text'>
Capability checking was incorrectly done on just the base name
rather than on the whole path.  Consequently there could be both
false positives and negatives when coloring files with capabilities.
Also capability checking was not done at all in certain cases for
non executable files.  Note passing absolute rather than relative
names to cap_get_file() reduces the has_capability() overhead
from around 33% to 30%.  I.E. ls --color is now around 3% faster.

* src/ls.c (struct fileinfo): Add a has_capability member.
(print_color_indicator): Refactor to pass just a fileinfo pointer
and a flag to say if we're dealing with a symlink target.
(print_name_with_quoting): Likewise.
(gobble_file): Set has_capability in the fileinfo struct.  Also do
a capability check even if executable coloring is disabled.
Ditto for SETUID and SETUID coloring.
Comment on how expensive has_capability() is.
(print_long_format): Adjust to refactored print_name_with_quoting.
(quote_name): Likewise.
(print_file_name_and_frills): Likewise.
* tests/ls/capability: Test the various false positive and negatives.
* THANKS: Add reporter (Ivan Labath).
* NEWS: Mention the fix.
</content>
</entry>
<entry>
<title>ls: remove explicit getfilecon work-around</title>
<updated>2009-10-09T12:33:10Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-10-07T20:29:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=57d9263ca54a35e76fc8ed2ec3ec8dc36f8da60b'/>
<id>urn:sha1:57d9263ca54a35e76fc8ed2ec3ec8dc36f8da60b</id>
<content type='text'>
* src/ls.c (gobble_file): Remove l?getfilecon work-around,
now that the gnulib wrappers handle it for us.
</content>
</entry>
<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: don't use an undefined struct stat after failed stat/lstat</title>
<updated>2009-09-29T12:12:30Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-09-29T05:28:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/coreutils/commit/?id=b7aaa0da8b47f4f373d3e0876bd540986278c6e2'/>
<id>urn:sha1:b7aaa0da8b47f4f373d3e0876bd540986278c6e2</id>
<content type='text'>
* src/ls.c (format_inode): Access f-&gt;stat only if f-&gt;stat_ok is set.
* NEWS (Bug fixes): Mention it.
Improved-by: Pádraig Brady &lt;P@draigBrady.com&gt;
</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>
</feed>
