Age | Commit message (Collapse) | Author |
|
Postpone installation of signal handlers until they're needed.
That is right before the first escape sequence is printed.
* src/ls.c (signal_setup): A new function refactored from main()
to set and restore signal handlers.
(main): Move signal handler setup to put_indicator()
so that the default signal handling is untouched as long as possible.
Adjusted condition for restoring signal handlers to reflect the change.
(put_indicator): Install signal handlers if called for the very first
time. It uses the same code that was in main() prior to this commit.
* NEWS: Mention the improvement.
See https://bugzilla.redhat.com/1365933
Fixes http://bugs.gnu.org/24232
|
|
* src/dircolors.hin: Add .zst and .tzst suffixes for the
Zstandard/zstd compression tools. See http://zStd.net and
https://code.facebook.com/posts/1658392934479273/
|
|
* src/tr.c (unquote): Use indices of type "unsigned int", rather
than a mix or "size_t" and "int", presuming that no command-line-
specified string will have length longer than UINT_MAX.
|
|
|
|
* src/ptx.c (fix_output_parameters): Switch to an unsigned type that
matches the OCCURS.file_index type. This avoids the following error
from gcc-7.0.0 20160829 (experimental):
src/ptx.c:1220:14: error: assuming signed overflow does not occur \
when simplifying conditional to constant [-Werror=strict-overflow]
if (file_index > 0)
|
|
* src/cp.c (make_dir_parents_private): Use default permissions for
created directories when --no-preserve=mode is specified.
* tests/cp/cp-parents.sh: Add a test case.
* NEWS: Mention the fix.
Fixes http://bugs.gnu.org/24251
|
|
* src/dd.c (usage): Add a comma which is significant for
the rewrapping done in man pages.
|
|
* src/expand.c, src/unexpand.c: Move global variables from here...
* src/expand-common.h, src/expand-common.c: ... to here.
* src/expand.c, src/unexpand.c: (parse_tab_stops, validate_tab_stops,
next_file): Move identical functions to new module.
(add_tab_stop): Move to new module, including additional code from
'unexpand' (keeping max_column_width) which will have no effect in when
used in 'expand'. Refactor common next-column calculation code
into a new function 'get_next_tab_column'.
* src/local.mk: (src_expand_SOURCES, src_unexpand_SOURCES): Add
'expand-common.c'; (noinst_HEADERS): Add 'expand-common.h'.
* po/POTFILES.in: Add 'expand-common.c'.
* tests/misc/expand.pl: Add more tests.
* tests/misc/unexpand.pl: Likewise.
* TODO: Move conclusions to above test after investigation.
|
|
Use hash table for seaching in filter_mount_list() and get_dev()
This improves performance for 20K mount entries from:
real 0m1.731s
user 0m0.532s
sys 0m1.188s
to:
real 0m1.066s
user 0m0.028s
sys 0m1.032s
* src/df.c (devlist_table): Define hash table.
(devlist_hash): Add hash function.
(devlist_compare): Add hash comparison function.
(devlist_for_dev): Add lookup function.
(devlist_free): Add cleanup function.
(filter_mount_list): Use the above hash table.
While at it, rename the variable 'devlist' to 'seen_dev' for
better readability.
(me_for_dev): Use the above lookup function.
NEWS: Mention the improvement.
THANKS.in: Remove the committer; add original submitter Josef Cejka.
|
|
* src/date.c (usage): This was thought to introduce other ambiguities,
and was inconsistent with the format presented in the touch(1) docs.
* doc/coreutils.texi (date invocation): Likewise.
See http://bugs.gnu.org/24077
|
|
src/id.c:249:29: error: potential null pointer dereference \
[-Werror=null-dereference]
pw_name = xstrdup (pwd->pw_name);
~~~^~~~~~~~~
src/whoami.c:89:11: error: potential null pointer dereference \
[-Werror=null-dereference]
puts (pw->pw_name);
~~^~~~~~~~~
* src/id.c (main): Explicitly exit with EXIT_FAILURE after an eror to
help gcc-6 to detect that the dereferenced pointer is valid.
* src/whoami.c (main): Likewise.
|
|
* src/date.c (usage): Make the characters used to summarize
the input format, match the output +FORMAT characters.
* doc/coreutils.texi (date invocation): Likewise.
Fixes http://bugs.gnu.org/24077
|
|
* src/sort.c (traverse_raw_number): Accept thousands separator only
if it is immediately followed by a digit.
* tests/misc/sort-h-thousands-sep.sh: Cover the fix for this bug.
Suggested by Pádraig Brady in http://bugs.gnu.org/24015
|
|
* src/sort.c (traverse_raw_number): Allow to skip only one occurrence
of thousands_sep to avoid finding the unit in the next column in case
thousands_sep matches as blank and is used as column delimiter.
* tests/misc/sort-h-thousands-sep.sh: Add regression test for this bug.
* tests/local.mk: Reference the test.
* NEWS: Mention the bug fix.
Reported at https://bugzilla.redhat.com/1355780
Fixes http://bugs.gnu.org/24015
|
|
* src/sort.c (traverse_raw_number): New function for traversing numbers.
(find_unit_order): Use traverse_raw_number() instead of open-coding it.
(debug_key): Likewise.
|
|
* doc/coreutils.texi (install invocation): Update -Z documentation.
* src/install.c (make_ancestor): Set default security context before
calling mkdir() if the -Z option is given.
(process_dir): Call restorecon() on the destination directory if the
-Z option is given.
(usage): Update -Z documentation.
* tests/install/install-Z-selinux.sh: A new test for 'install -Z -D'
and 'install -Z -d' based on tests/mkdir/restorecon.sh.
* tests/local.mk: Reference the test.
* NEWS: Mention the improvement.
Reported at https://bugzilla.redhat.com/1339135
Fixes http://bugs.gnu.org/23868
|
|
* src/stty.c: Disable setting of "swtch" to ^z as that
conflicts with and disables using ^z as "susp".
* NEWS: Mention the bug fix.
Reported and tested by Rich Burridge at:
http://bugs.gnu.org/23866
|
|
* src/yes.c: Include full-write.h.
(main): Use full_write, not write, to simplify handling of partial
writes. Don't bother using stdio to output data; just use
full_write with a buffer as large as needed. Reuse operand
strings if possible, and if the buffer would otherwise be large.
|
|
* src/yes.c (main): Loop over the write buffer to
handle the case where write may write less than requested.
* NEWS: Mention the bug fix.
Reported by Paul Eggert.
|
|
* src/yes.c (main): Output 'y' not '-'.
* tests/misc/yes.sh: Add a test for default output.
|
|
GCC 7 warned about undefined behavior in this unlikely case.
Problem reported by Jim Meyering in: http://bugs.gnu.org/23825
* src/md5sum.c (main):
* src/paste.c (main):
* src/yes.c (main):
Avoid undefined behavior when argc == INT_MAX.
|
|
Print warning regardless of locale, avoid warning if key is zero width.
Problem reported by Karl Berry in http://bugs.gnu.org/23665 .
* src/sort.c: (key_warnings): change conditions for 'leading spaces'
warning.
* tests/misc/sort-debug-warn.sh: adjust tests accordingly.
|
|
* src/dircolors.hin: Reduce the list by replacing all specific
mentions of "color" with the pattern "*color*". This will also
cater for other entries like "konsole-256color".
Fixes http://bugs.gnu.org/23542
|
|
* NEWS: Mention the bug fix.
* src/nl.c (proc_body, proc_footer): Reset numbering here too.
* doc/coreutils.texi (nl invocation): Adjust for behavior change.
* tests/misc/nl.sh: Add a test case.
|
|
* stc/stat.c (human_fstype): Add file system ID definition,
and use "smb2" as the name.
* NEWS (Improvements): Mention the change.
Fixes http://bugs.gnu.org/23516
|
|
* src/id.c (main): When configured with --enable-gcc-warnings and using
the very latest gcc built from git, building would fail with this:
src/id.c:200:8: error: assuming signed overflow does not occur when \
simplifying conditional to constant [-Werror=strict-overflow]
bool default_format = (just_user + just_group + just_group_list
^~~~~~~~~~~~~~
Rewrite to use bool-appropriate operators.
|
|
Ensure I/O errors are detected (and terminate seq), preventing seq
from infloop (or running for long time with a large
range) upon write errors or ignored SIGPIPE. Examples:
seq 1 inf > /dev/full (seq_fast)
seq 1.1 0.1 inf >/dev/full (print_numbers)
* src/seq.c (io_error): A new function to diagnose appropriate
stdio errors and exit the program with failure status.
(seq_fast, print_numbers): Explicitly check for write errors
and terminate the program with diagnostic.
* tests/misc/seq-io-errors.sh: Test error detection with /dev/full.
* tests/misc/seq-epipe.sh: Test error detection with broken pipes.
* tests/local.mk: Add new tests.
* NEWS: Mention the fix.
|
|
* src/stat.c (human_fstype): Add file system ID definition,
and use "wslfs" as the name.
* NEWS (Improvements): Mention the change.
Fixes http://bugs.gnu.org/23273
|
|
* src/yes.c (main): For large inputs only write a single
diagnostic for write errors.
* tests/misc/yes.sh: Test when /dev/full is available.
|
|
* src/sleep.c (main): Allow ERANGE since we allow "inf" values.
* src/timeout.c (parse_duration): Likewise.
* tests/misc/sleep.sh: New file. Tests for sleep(1).
* tests/misc/timeout-parameters.sh: Add case for newly allowed
$LDBL_MAX. Also use returns_ throughout the file. Also avoid
small timeout values which might give false failures under load.
|
|
* src/seq.c (isnan): Define macro.
(scan_arg): Add check if the given argument is NaN, and exit with
a proper error diagnostic in such a case.
(usage): Document it.
* tests/misc/seq.pl: Add tests.
* doc/coreutils.texi (seq invocation): Document the change.
* NEWS (Changes in behavior): Mention the change.
|
|
* src/seq.c (main): Exit with an error diagnostic when the given
step value is Zero.
(usage): Document it.
* doc/coreutils.texi (seq invocation): Likewise.
* tests/misc/seq.pl: Add tests.
* NEWS (Changes in behavior): Mention the change.
Reported by Маренков Евгений in:
http://bugs.gnu.org/23110
|
|
* src/stat.c (human_fstype): Add file system ID definition.
* NEWS (Improvements): Mention the change, moving the previously added
"prl_fs" change note from "Changes in behavior" to here.
Fixes http://bugs.gnu.org/23283
|
|
* src/stat.c (human_fstype): Identify the parallels file system.
Also tag as remote so that tail(1) doesn't use inotify, which
fails to detect changes made outside a VM.
Fixes http://bugs.gnu.org/23143
|
|
The problematic code computed a struct tm in one time zone, and
then printed it or converted it to a string in another. To be
portable the same time zone needs to be used for both operations.
On GNU platforms this is not an issue, but incorrect output can be
generated on System V style platforms like AIX where time zone
abbreviations are available only in the 'tzname' global variable.
Problem reported by Assaf Gordon in: http://bugs.gnu.org/23035
* NEWS: Document the bug.
* src/date.c (show_date):
* src/ls.c (long_time_expected_width, print_long_format):
* src/pr.c (init_header):
* src/stat.c (human_time): Use localtime_rz instead of localtime,
so that the time zone information is consistent for both localtime
and time-formatting functions like fprintftime and nstrftime. For
'stat' this change is mostly just a code cleanup but it also
causes stat to also print nanoseconds when printing time stamps
that are out of localtime range, as this is more consistent with
what other programs do. For programs other than 'stat' this fixes
bugs with time zone formats that use %Z.
* src/du.c, src/pr.c (localtz): New static var.
(main): Initialize it.
* src/du.c (show_date): New time zone argument, so that localtime
and fprintftime use the same time zone information. All callers
changed.
* tests/misc/time-style.sh: New file.
* tests/local.mk (all_tests): Add it.
* tests/misc/date.pl: Test alphabetic time zone abbreviations.
|
|
POSIX recommends avoiding -a and -o, for good reason.
src/test.c (usage): Mention that inherent ambiguities exist with
binary -a and -o.
Problem reported by Martin Gebert in: http://bugs.gnu.org/22909
|
|
sort, tail, and uniq now support traditional usage like 'sort +2'
and 'tail +10' on systems conforming to POSIX 1003.1-2008 and later.
* NEWS: Document this.
* doc/coreutils.texi (Standards conformance, tail invocation)
(sort invocation, uniq invocation, touch invocation):
Document new behavior, or behavior's dependence on POSIX 1003.1-2001.
* src/sort.c (struct keyfield.traditional_used):
Rename from obsolete_used, since implementations are now allowed
to support it. All uses changed.
(main): Allow traditional usage if _POSIX2_VERSION is 200809.
* src/tail.c (parse_obsolete_option): Distinguish between
traditional usage (which POSIX 2008 and later allows) and obsolete
(which it still does not).
* src/uniq.c (strict_posix2): New function.
(main): Allow traditional usage if _POSIX2_VERSION is 200809.
* tests/misc/tail.pl: Test for new behavior.
|
|
* src/date.c (main): Free TZ variable to pacify valgrind, guarded
by IF_LINT.
|
|
* src/split.c (lines_rr): Reinstate the conditional
setting of the WROTE boolean, as otherwise split -n r/1 would
consume all input when all --filter commands are stopped.
There was a test in place to check for this, but
it was incorrect as detailed below.
(input_file_size): Immediately disallow --number with
non seekable inputs, as such an invocation is not currently
generally supported and will fail as the data overflows
the internal buffer.
* tests/split/l-chunk.sh: Adjust to again disallow -n /dev/zero.
Also change all '&& fail=1' checks to use the 'returns_ 1' form.
* tests/split/filter.sh: Change the no longer supported /dev/zero
case to a regular $OFF_T_MAX file (supported on XFS for example).
Also fix the timeout(1) commands so they're not subject to
pipefail issues.
|
|
* src/stty.c (usage): Remove an erroneous call to translate an
empty string, added in commit v8.23-112-g564f84a, which results
in the gettext header being printed for translated languages.
* THANKS.in: Remove the now committer.
* NEWS: Mention the bug fix.
|
|
Problem reported by Nelson H.F. Beebe in: http://bugs.gnu.org/22624
Other problems also fixed: basically, the code got confused because
GNU/Linux reports that /dev/zero has size zero.
* src/split.c (input_file_size): Now takes struct stat *, not just
size. Always store the first buffer. All callers changed. Treat
/dev/zero as an infinitely-large file, both on GNU/Linux where
fstat and lseek say its size is zero, and on GNU/Hurd where they
say the size is OFF_T_MAX.
(cwrite): Return true on success.
(bytes_split): Don't try to read past EOF, and stop if a write fails.
(lines_rr): Omit stray check for ignorable errno.
(main): Get file size only when n_units > 1, since that's the only
time it is needed. Defer most of the work to input_file_size.
* tests/split/l-chunk.sh: Adjust tests to match new behavior
on oddball inputs.
|
|
* src/date.c (usage): The colon is used in the timezone offset
since commit v8.24-64-g17bbf6c.
* THANKS.in: Remove committer.
Fixes http://bugs.gnu.org/22491
|
|
Solaris Studio 12 on sparc (not x86) will not remove
unused functions, thus leaving a reference to an
undefined program_name symbol from emit_try_help().
* src/system.h (emit_try_help): Change from an inline function
to a macro, so that the inline function is not actually
defined in libstdbuf.c.
Fixes http://bugs.gnu.org/22430
|
|
tests/tail-2/F-headers.sh and test/tail-2/retry.sh fail on
on remote file systems due to tail going into inotify mode
due to not being able to determine the remoteness of the
non existent files.
* src/tail.c (any_non_remote_file): A new function used
to disable inotify when there are no open files, as
we can't determine remoteness in that case.
* NEWS: Mention the bug fix.
|
|
* src/copy.c (copy internal): Remember directories irrespective
of their link count, because on some file systems like BTRFS,
directories always have a link count of 1.
|
|
* src/operand2sig.c (operand2sig): Add a detailed comment explaining
why we validate even very large shell exit status values.
* tests/misc/kill.sh: Add a test case for the ksh scheme.
Simplify the INVALID signal number determination which also avoids
a false failure on systems like FreeBSD 10 with incomplete
signal list (caused by inaccurate NSIG).
|
|
Locale categories are not equivalent on OpenBSD,
and LC_COLLATE only supports "C" for example.
Now LC_ALL is supported to set multiple other categories
on OpenBSD, so setlocale(LC_ALL, "") returns a string
indicating which categories were updated and which ignored.
Therefore...
* src/sort.c (main): ...Call setlocale(LC_COLLATE, "")
to explicitly check whether a specified LC_ALL or
LC_COLLATE environment variable value is supported
for the LC_COLLATE category. Also use !! to explicitly
convert to bool to support c89 systems where bool is an int,
and thus would get values > 1.
Reported by Assaf Gordon.
|
|
doc/coreutils.texi (dd invocation): Add oflag=sync to the streaming
example. Also reference the "direct" flag. Mention this is only
a request to the system.
* src/dd.c (usage): Mention the "sync" flag along with "nocache".
Also mention that it's only a request to drop the cache.
* THANKS.in: Add reporter Francois Rigault.
|
|
* src/stat.c (usage): Mention the '#' and '0' flags are useful with %a.
* doc/coreutils.texi (stat invocation): Likewise. Also give an example
printing unambiguous octal output.
Reported at http://bugs.debian.org/810539
|
|
commit v8.23-31-g90aa291 failed to consider this case,
where the previous rename has failed, thus causing the
following to remove the specified directory:
mv dir dir dir
* src/copy.c (copy_internal): Assume this rename attempt has
succeeded, as a previous failure will already have been handled,
and we don't want to remove the source directory in this case.
* tests/cp/duplicate-sources.sh: Consolidate this test file to...
* tests/mv/dup-source.sh: ...here. Add test cases for same
source and dest.
* tests/local.mk: Remove the consolidated test.
* NEWS: Mention the bug fix.
Reported at https://bugzilla.redhat.com/1297464
|