Update to 2.7.1
Changes in version 2.7.1:
* Two critical bug fixes in the "diff --git" format support.
* Clarify the message printed when a patch is expected to empty out and delete
a file, but the file does not become empty.
* Various improvements to messages when applying a patch to a file of different
type (regular file vs. symlink), when there are line ending differences (LF
vs. CRLF), and when in --dry-run mode.
* When in the root directory, allow file names that are absolute or that
contain a component of "..".
* New --follow-symlinks option to allow to treat symlinks as files: this was
patch's behavior before version 2.7.
* Ignore when extended attributes cannot be preserved because they are
unsupported or because permission to set them is denied.
* License clarifications in NEWS and README.
* Portability bug fixes.
Changes in version 2.7:
* Patch no longer gets a failed assertion for certain mangled patches.
* Ignore destination file names that are absolute or that contain a component
of "..". This addresses CVE-2010-4651.
* Support for most features of the "diff --git" format, including \
copies, permission changes, and symlink diffs. Binary diffs are not
supported yet; patch will complain and skip them.
* Support for double-quoted filenames: when a filename starts with a double
quote, it is interpreted as a C string literal. The escape sequences \\, \",
\a, \b, \f, \n, \r, \t, \v, and \ooo (a three-digit octal number between 0
and 255) are recognized.
* Refuse to apply a normal patch to a symlink. (Previous versions of patch
were replacing the symlink with a regular file.)
* When trying to modify a read-only file, warn about the potential problem
by default. The --read-only command line option allows to change this
* Files to be deleted are deleted once the entire input has been processed, not
immediately. This fixes a bug with numbered backup files.
* When a timestamp specifies a time zone, honor that instead of assuming the
local time zone (--set-date) or Universal Coordinated Time (--set-utc).
* Support for nanosecond precision timestamps.
* Many portability and bug fixes.
Changes in version 2.6.1:
* Support for diff3(1) style merges which show the old, original, and new lines
of a conflict has been added (--merge=diff3). The default still is the
merge(1) format (--merge or --merge=merge).
* Bug and portability fixes.
Changes in version 2.6:
* A regression test suite has been added ("make check").
* A --merge option has been added which will merge a patch file into
the original files similar to merge(1). See the patch(1) manual page for
* Unless a filename has been specified on the command line, look only
for filenames in the patch until one has been found. This prevents
patch from tripping over garbage that isn't a patch. When conforming
to POSIX, this behavior is turned off and patch will ask for a
filename if none is found.
* All reject files have file name headers, which allows them to be used as
* When a patch file modifies the same file more than once, patch makes
sure it backs up the original version of the file rather than any
* In the above situation, if there are rejects in more than one of those
patches, they all go into the same reject file.
* When the file to be patched is specified on the command line, all patches
are applied to that file. (Previously, the first patch was applied to the
file specified on the command line, and the names of additional files to
patch were taken from header lines in the patch file.)
* The -r option now works correctly even if there are rejects in more than
one file. Use the - argument to discard rejects.
* Rejected hunks come out in unified diff format if the input patch was of
that format, otherwise in ordinary context diff form. Use the
--reject-format option to enforce either "context" or \
Timestamps and the "diff -p" (--show-c-function) output are preserved.
Changed lines in context format reject files are correctly indicated
with '!' markers as the format defines. Added and removed lines are
still marked with '+' and '-', respectively.
* The file permissions of reject files are no longer set to match the files
they modify. Instead, they retain the default permissions. This is
consistent with reject files produced with the -r option.
* The --binary option disables the heuristic for stripping CRs from
line endings in patches. This allows to preserve CRs even in mangled
patches, or in patches generated on non-POSIX systems and without the
* Backup files for nonexisting files are now created with default
permissions rather than with mode 0: backup files with mode 0 were
causing problems with applications which do not expect unreadable
* The -B, -Y, and -z options (--prefix, --basename-prefix, --suffix) now
imply the simple version control mode, and can be combined.
* Patch rejects more malformed normal format commands and checks for trailing
garbage. It now recognizes ed commands without addresses.
* Change the default value of PATCH_GET to 0. (Previously, the default was 0
under POSIXLY_CORRECT and negative otherwise; this is causing problems
particularly with Perforce.)
* Handle missing timestamps better.
* Various bug fixes.
* Switch to GNU General Public License version 3.