tests: accommodate ls' "alternate access control method" indicator
ls can output an additional byte after a file's permissions string,
e.g., rather than "rwxr--r-- ..." it can output "rwxr--r--+ ..."
or "rwxr--r--. ..." to indicate the presence of an ACL.
* tests/create-delete: Adjust sed filter to accommodate that.
* tests/preserve-mode-and-timestamp: Likewise.
* tests/test-lib.sh: Unset environment variables that influence
the behavior of patch.
* util.c (move_file): Add debug message when files have been seen
already. Fix leftover "empty uneadable" debug message.
Patch recognizes patches that have had their line endings converted
to CRLF and automatically strips CRs in that case. This generally is
the desired behavior, but if both the patch and the file(s) being patched have
CRLF line endings, patches that would apply without this heuristic will fail.
Modify the --binary option to disable the trailing CR stripping heuristic.
When a patch references a file more than once, patch may override
reject files it had just created.
Avoid this by first checking whether we have created reject files
ourselves, and append to such files instead of overwriting them in
that case. (This is similar to the backup file case except that
in the backup case, we must skip creating another backup instead
of appending.)
With a patch that includes rejects in more than one file and with the -r
option, rejects would overwrite themselves and only the rejects from
the last file would remain. Fix this.
No longer set reject file modes to the modes of the files they are
assiciated with: the previous behavior is inconsistent with global
reject files (-r), which are not associated with any particular file.
On Sun, 26 Aug 2007 13:50:45 +0200 Jim Meyering wrote:
> The problem arises when the input is a context diff and the second
> byte on a line of context is not a space or tab.
> Patch then happily gobbles/ignores that bogus byte and outputs
> the rest of the line with an additional (NUL) byte at the end.
> [...]
> Alternatively, and perhaps better, would be to warn about
> the corrupt patch and exit right away, but I'm not sure this
> is an officially corrupt patch since patch is rather liberal
> in what it accepts: should that space in column 2 really be optional
> for context diffs?
Patch fails with "Assertion `s && size' failed" when it sees
a zero-length line. However, as the test case shows, a zero-
length line can occur as the last line of a patch.
Reported by Clarence Dang <clarencedang@users.sourceforge.net>.