When LS_COLORS sets a `no` style, ls emits a reset sequence before the
first listed line. Those bytes were written straight to the output
without advancing the //DIRED// line offset, so every reported pair was
short by the length of the reset and pointed inside the escape sequence
instead of at the name.
print_dired_output ignored the BufWriter it was given and used the print
macros, which panic on a write error, and its flush reported one as a
plain I/O error. Write the trailer through the BufWriter instead, so a
failure is reported as GNU does: "write error", exit 2.
https://github.com/uutils/coreutils/issues/14497
The //DIRED// byte offsets also covered the color escapes around the
name, the -F indicator and the alignment space before an unquoted name.
GNU excludes all three, so Emacs Dired got a name it could not use.
https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2147527
Concurrent install -D invocations sharing parent directories race in
open_or_create_subdir between stat_at returning NotFound and mkdir_at.
Another process can create the directory in that gap, so our mkdir_at
returns EEXIST. Retry the stat to open the directory the other process
created.
Fixes#12355.
Every other sort in sort_entries falls back on the name when its key
ties. Sorting by time did not, so entries sharing a timestamp came out
in the order the directory was read in, and since the sort is unstable
that order was not guaranteed either.
GNU ls breaks the tie with the collation rather than with the bytes, so
the comparison Sort::Name already builds is hoisted out of the match and
the fallback uses that same one.
-v printed only the exec, not what it did to the environment first, so
the three lines GNU emits before it were missing:
$ env -v -u A FOO=1 true
unset: A
setenv: FOO=1
executing: true
arg[0]= 'true'
and 'cleaning environ' for -i. The individual unsets are not logged when
-i is in effect, since it has already emptied the environment.
GNU's echo recognizes only \a \b \c \e \f \n \r \t \v \\ \0NNN \NNN and
\xHH after -e. uucore's escape parser is shared with printf, which also
recognizes \", \uHHHH and \UHHHHHHHH, so echo -e picked those up as well:
echo -e '\u0041' printed A instead of \u0041.
Add an EscapeSet parameter alongside the existing OctalParsing one, and
have echo ask for the set without \", \u and \U. Those three then fall
through to the unknown-escape arm and are emitted verbatim, backslash
included, which is what GNU does. printf keeps the full set on both its
format-string and %b paths.