Jim Meyering [Tue, 21 Jan 2003 12:36:56 +0000 (12:36 +0000)]
Don't assume that the file owner username
length is less than 9 in ls output: instead, omit that field
altogether. Reported by, and suggested fix from, Ferdinand.
Jim Meyering [Tue, 21 Jan 2003 08:57:13 +0000 (08:57 +0000)]
[! weak_alias]: Define __-prefixed names to publicized ones.
[! defined _LIBC]: Define-away weak_alias and internal_function.
[defined weak_alias]: Guard each use of weak_alias.
Jim Meyering [Sat, 18 Jan 2003 18:36:13 +0000 (18:36 +0000)]
(Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]: New member.
(enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
(long_options): Add option --dereference-command-line-symlink-to-dir.
(main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
-d, -F, -l options is specified.
(decode_switches): Handle --dereference-command-line-symlink-to-dir.
(gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
Change --dereference-command-line (-H) to dereference *all*
command line arguments, including broken symlinks.
Jim Meyering [Sat, 18 Jan 2003 18:01:51 +0000 (18:01 +0000)]
Change ls -H back to the way it was yesterday, since this is
compatible with FreeBSD and the POSIX spec is confusing
and somewhat contradictory.
(DEREF_COMMAND_LINE_ARGUMENTS): Change name back
from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
(long_options): Change the long option name back.
(usage): Change the usage back.
(gobble_file): When -H is specified, dereference a top-level
arg even if it points to a non-directory.
Jim Meyering [Wed, 15 Jan 2003 13:09:00 +0000 (13:09 +0000)]
(General output formatting): Reflect option name change:
s/--dereference-command-line/--dereference-command-line-symlink-to-dir/.
Say that this option changes how ls treats only symlinks to directories
specified on the command line.
Jim Meyering [Wed, 15 Jan 2003 11:59:07 +0000 (11:59 +0000)]
(gobble_file): Fall back on using lstat when required:
when --dereference (-L) is not specified, and
- when operating on a dangling symlink
- when operating on command-line-symlink-to-directories
This fixes numerous problems. Here are examples:
- `ls dangling-symlink' would fail with `no such file...'
Now it prints `dangling-symlink'.
- `ls -i symlink' would mistakenly print the inode of the referent.
Now it prints the inode of the symlink. Likewise for --size (-s).
Based on a patch from Michael Stone.
Reported by Deepak Goel as Debian bug #173793.
Jim Meyering [Wed, 15 Jan 2003 11:32:47 +0000 (11:32 +0000)]
Rename ls's --dereference-command-line (-H)
option to --dereference-command-line-symlink-to-dir.
[enum Dereference_symlink]
(DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
(long_options): Rename the option.
(usage): Say that --dereference-... changes how ls treats
only symlinks to directories specified on the command line.
Jim Meyering [Tue, 14 Jan 2003 16:22:55 +0000 (16:22 +0000)]
(gobble_file): Fix a bug introduced in 4.5.4 that made it
so that ls --color would no longer highlight the names of files with
the execute bit set when not specified on the command line.
Patch by Michael Stone. Reported by Stephen Depooter as
Debian bug 175135.