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.
Jim Meyering [Sun, 12 Jan 2003 11:51:36 +0000 (11:51 +0000)]
Lots of syntactic clean-up, mostly from Karl Berry.
Use consistent indentation, two spaces per level.
(scriptversion): New variable.
Change initializations like `variable=""' to `variable='.
(usage): New variable.
Use `test', not `['.
Use `test -n "$var"', not `[ x"$var" = x ]'.
Use `test -z "$var"', not `[ x"$var" != x ]'.
Alphabetize case entries.
Accept --help and --version options.
Remove unnecessary `else :' clauses.
Add a `Local variables' eval block to help emacs users update
the time-stamp variable added above.