bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coreutils-6.1: needs 'ls' patch (bug #15043)


From: Jim Meyering
Subject: Re: coreutils-6.1: needs 'ls' patch (bug #15043)
Date: Fri, 25 Aug 2006 19:18:41 +0200

mwoehlke <address@hidden> wrote:
> Mike Frysinger wrote:
>> On Thursday 24 August 2006 17:03, mwoehlke wrote:
>>> https://savannah.gnu.org/bugs/?func=detailitem&item_id=15043
>>>
>>> Is this going to get fixed, or what? There is a trivial fix available,
>>> it just needs someone that knows how to make it 'Linux-only'.
>> #if __linux__
>> <foo>
>> #endif
>> -mike
>
> Ok, thanks. I a: wasn't sure of a macro that would be defined on Linux
> (is there a list of these things anywhere? Preferably covering most
> major platforms?), and b: wasn't sure if people here appreciated such
> patches.
>
> If #ifdef is OK, this should do it (works for me with 5.97 and 6.1):

Thanks for pursuing that.
No #ifdef needed.
Here's the patch I'll probably commit (destined for the trunk):

Index: src/ls.c
===================================================================
RCS file: /fetish/cu/src/ls.c,v
retrieving revision 1.438
diff -u -p -r1.438 ls.c
--- src/ls.c    23 Aug 2006 19:19:02 -0000      1.438
+++ src/ls.c    25 Aug 2006 16:40:57 -0000
@@ -2531,6 +2531,10 @@ gobble_file (char const *name, enum file
 
   if (command_line_arg
       || format_needs_stat
+      /* When coloring a directory (we may know the type from
+        direct.d_type), we have to stat it in order to indicate
+        sticky and/or other-writable attributes.  */
+      || (type == directory && print_with_color)
       || (print_inode
          && (inode == NOT_AN_INODE_NUMBER
              /* When dereferencing symlinks, the inode must come from

As usual, it requires an addition to the test suite.
That is a little tricky, since the test will have to be
skipped on a file system without d_type support.

I'll do that part later.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]