diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2021-07-27 14:27:00 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-07-27 18:08:38 -0700 |
| commit | 9e4a6101f239b8168144078edd04843dea4dc69f (patch) | |
| tree | bf88cc241a68119b3f83452b3ef2862283b7367f /scripts/git-hooks/commit-msg | |
| parent | maint: avoid recent syntax-check issues (diff) | |
| download | coreutils-9e4a6101f239b8168144078edd04843dea4dc69f.tar.gz coreutils-9e4a6101f239b8168144078edd04843dea4dc69f.zip | |
ls: compute defaults more lazily
* src/ls.c (enum time_type, enum sort_type, enum indicator_style)
(enum Dereference_symlink, ignore_mode):
Put ‘= 0’ after default values, since the code relies
on static storage defaulting to zero.
(enum sort_type): Reorder so that -1 can be used to represent unset.
(main): Test print_with_color after parse_ls_color may have reset it.
(decode_line_length): Return the line length instead of setting
static storage. All uses changed. Treat line lengths exceeding
PTRDIFF_MAX as infinite, to avoid pointer-subtraction glitches.
(stdout_isatty): New function, to avoid calling isatty twice.
(decode_switches): Calculate defaults more lazily, to avoid using
syscalls or getenv during startup unless the results are more
likely to be needed. Use -1 to indicate options that haven’t been
set on the command line yet. Move print_with_color test from
here to ‘main’. Suppress bogus GCC warning.
(getenv_quoting_style): Return the quoting style instead of
setting static storage.
(init_column_info): New arg MAX_COLS, to avoid recalculating it.
Caller changed.
Diffstat (limited to 'scripts/git-hooks/commit-msg')
0 files changed, 0 insertions, 0 deletions
