Age | Commit message (Collapse) | Author |
|
is no requirement for ACL support; particularly, it does not exist
on systems that have POSIX ACLs.
|
|
|
|
turn acts like --time-style='posix-long-iso' if the locale settings
are messed up.
|
|
|
|
|
|
TIMESPEC_NS macro.
|
|
other-writable, and sticky-and-other-writable directories.
(indicator_no[]): Add new symbols.
(indicator_name[]): Add corresponding mode strings.
(color_indicator[]): Add an entry for each new mode string.
(print_color_indicator): Honor new types.
From Mike Frysinger, based on a patch from Fedora.
|
|
be paranoid, and add a comment explaining why.
Paul Eggert mentioned the possibility.
|
|
That cannot happen when the result date's year is in range.
Add an assertion instead.
|
|
|
|
stropt.h -> stropts.h
|
|
|
|
|
|
corresponding option string and value arrays are consistent.
|
|
when computing the --author column width. This bug might have
resulted in misaligned columns when using the --author option
on the Hurd. Spotted by Arnold Robbins.
The bug was introduced on 2003-12-03.
|
|
(clear_files): Clear it.
(gobble_file): Set it if a file has an ACL.
(print_long_format): Omit needless space unless some file has an ACL.
|
|
(make_link_name): Renamed from make_link_path. All uses changed.
|
|
|
|
|
|
|
|
--indicator-style=slash, to avoid confusion with ls --directory.
(slash): Renamed from directory_only. All uses changed.
|
|
for -p.
(indicator_style_args, indicator_style_types): Set it appropriately.
(decode_switches, gobble_file, print_type_indicator):
(length_of_file_name_and_frills):
Implement the change described in NEWS.
(decode_switches): Quote ">", too.
(usage): Update to match the new behavior. Describe ">".
|
|
|
|
All uses changed.
(siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
(main) [! SA_NOCLDSTOP]: Use it.
|
|
(format_args, sort_args, time_args, decode_switches)
(gobble_file): Use NULL, not `0'.
|
|
|
|
|
|
(long_time_expected_width, print_long_format): Use it, to avoid
some possible denial-of-service attacks.
|
|
so format string abuse cannot provoke stack overflow.
(print_long_format): Likewise.
|
|
|
|
(get_current_time): gettimeofday always returns 0, so don't
check its result.
|
|
directory", not "not listing already-listed directory: %s", to
format already-listed directories, to be consistent with other
diagnostics involving file names and colons.
|
|
rather than explicit_arg, for consistency with copy.c.
(extract_dirs_from_files): Remove ignore_dot_and_dot_dot arg, since
it is deducible from dirname arg. All callers changed.
(extract_dirs_from_files, print_dir, queue_directory):
Add command_line_arg arg. All callers changed.
(struct pending): Add command_line_arg member.
(main): Use NULL rather than 0 when appropriate.
(set_exit_status, file_failure): New functions.
(queue_directory): Store command_line_arg into new structure.
(print_dir, gobble_file, get_link_name):
Use file_failure to report problems in accessing files,
so that the exit status is set consistently.
(print_dir): Simplify readdir failure code yet again.
If closedir fails, report "closing directory" rather than "reading
directory" failure.
(xstrcoll): Use set_exit_status to set status on failure.
|
|
All uses of EXIT_FAILURE replaced with LS_FAILURE, unless
specified below.
(main): Initialize exit failure to LS_FAILURE.
(print_dir, gobble_file, get_link_name, xstrcoll):
Set exit status to LS_MINOR_PROBLEM if the failure is minor.
(print_dir): Do not give up on entire directory merely because readdir
returns EOVERFLOW.
(usage): Explain exit status.
|
|
executables, don't stat every file.
(is_colored): New function.
(gobble_file): Use it.
(main): Use it here, in place of too-strict tests against NULL:
if either ORPHAN or MISSING was set to 0 from LS_COLORS, the
old test would fail.
|
|
'volatile' on a local variable. Rewrite to avoid unnecessary
double-assignment to 'func' in the usual case where strcoll does
not fail.
|
|
--human-readable (-h), --inode (-i), --size (-s), --time,
and --time-style.
|
|
Tweak indentation so that help2man creates better nroff.
|
|
problems. All uses changed.
|
|
|
|
(file_ignored): Renamed from file_interesting, with
inverted return value. Accept the file name, not a struct dirent *.
All uses changed. Avoid the expense of calling fnmatch if the
file is ignorable due to leading '.'.
(all_files, really_all_files): Removed; replaced by:
(ignore): New variable. All uses changed.
(IGNORE_DEFAULT, IGNORE_DOT_AND_DOTDOT, IGNORE_MINIMAL, HIDE_OPTION):
New constants.
(hide_patterns): New variable.
(long_options, decode_switches, file_ignored, usage):
Add support for --hide.
(patterns_match): New function.
(usage): Replace "hide" with "ignore" in explanation, to avoid
confusion.
|
|
|
|
human-readable output has a byte count equal to its column width;
this isn't always true in locales where the radix character is not
'.' or ','.
(format_user_or_group): Revamp code to match the above fix;
this avoids the (very faint) possibility of integer overflow.
|
|
to SIZE_MAX: GCC sometimes complains.
|
|
|
|
extract_dirs_from_files, color_symlink_as_referent,
FILE_OR_LINK_MODE, sort_reverse, print_owner, print_group,
numeric_ids, print_block_size, dired, print_with_color,
check_symlink_color, print_inode, recursive, immediate_dirs,
all_files, really_all_files, qmark_funny_chars,
print_dir_name, format_needs_stat, format_needs_type, visit_dir,
main, decode_switches, parse_ls_color, print_dir, file_interesting,
gobble_file, make_link_path, basename_is_dot_or_dotdot,
extract_dirs_from_files, print_long_format):
Use bool for booleans.
(dir_defaulted): Remove; no longer needed.
(main): Use int to count files, since it suffices for argv.
Rewrite to avoid need for dir_defaulted.
(main, print_dir, gobble_file, get_link_name,
xstrcoll):
Set exit status to EXIT_SUCCES/EXIT_FAILURE rather than 0/1.
(decode_switches): Put back check for ws.ws_col <= SIZE_MAX.
Remove unnecessary cast to int. Use int instead of unsigned
int to count from 0 to 1.
(get_funky_string, print_type_indicator): Use char for bytes, not int.
(make_link_path): Use NULL for null pointers.
(quote_name): Use to_uchar instead of cast.
|
|
names contained multibyte characters where the column count
differed from the byte count. This patch also corrects
some comments.
(format_user_or_group): New function, which counts columns correctly.
(format_user, format_group): Use it.
(format_user_or_group_width): New function, which counts columns correctly.
(format_user_width, format_group_width): Use it.
|
|
is set. POSIX reserves upper-case environment variables to the
implementation, so it's OK for ls to depend on TABSIZE.
|
|
|
|
happen between arbitrary output bytes, as the
restore-default-color sequence can bollix up multibyte chars or
color-change sequences in the ordinary output. Instead, process
signals only between printing a file name and changing the color
back to non_filename_text color. That way, if the signal handler
changes the color (to the default), 'ls' will change it back when
'ls' continues (after being suspended).
Also, do not bother with signal-handling unless stdout is a
controlling terminal; this lets stdio buffer better when "ls
--color" is piped or sent to a file.
(sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]: New macros.
Do not include "full-write.h"; no longer needed.
(tcgetpgrp) [! HAVE_TCGETPGRP]: New macro.
(put_indicator_direct): Remove. All callers changed to use
put_indicator.
(caught_signals, interrupt_signal, stop_signal_count): New vars.
(restore_default_color): Don't bother checking for put_indicator
failure.
(sighandler): Don't handle SIGTSTP; that's another handler now.
Simply set interrupt_signal to the signal, then exit.
(stophandler, process_signals): New functions.
(main): Don't output any color changes until _after_ the signal
handlers are set up. This fixes a race condition where 'ls'
could be interrupted while initializing colors, and leaving the
terminal in an undesirable state.
Don't mess with signal-handling if standard output is not a
controlling terminal.
When exiting, restore the default color, then restore the
default signal handling, then act on any signals that weren't
acted on yet.
Do not print //DIRED// etc. in colors; this avoids the need
to catch signals when printing them.
(print_name_with_quoting): Process signals just before switching
color back to non_filename_text.
|