63 Commits

Author SHA1 Message Date
Andreas Gruenbacher
48ceda8200 Version 2.8
* NEWS: Update.
2025-03-29 17:17:03 +01:00
Paul Eggert
95e0092f97 maint: make update-copyright 2025-01-05 13:33:00 -08:00
Paul Eggert
9ba5eb00b3 Don’t be fooled by NUL bytes in diff directives
* src/pch.c (get_line, pget_line): New arg ALLOW_NUL.
It is true when getting data lines, which can contain NUL,
but false when getting ‘diff’ directives, which cannot.
All uses changed.
* tests/bad-filenames: Check that ‘patch’ rejects
directives containing NUL.
2024-09-17 17:43:23 -07:00
Andreas Gruenbacher
301411d927 Spelling fixes
Prefer 'timestamp' over 'time stamp'.
2024-09-17 10:59:25 +02:00
Andreas Gruenbacher
55e224bd73 Update old copyright notices
* NEWS: Replace the old copyright notice with the current version from
COPYING.
* m4/setmode.m4: Likewise.
2024-09-17 00:07:22 +02:00
Paul Eggert
cc87173e46 Update NEWS as per recent changes 2024-09-15 22:50:38 -07:00
Paul Eggert
30449e294b Fix compatibility issue with blanks in patches
* src/util.c (remove_prefix): Remove; no longer used.
* src/pch.c (intuit_diff_type, scan_linenum, another_hunk):
Allow a nonempty sequence of blanks in places where POSIX requires
support for these sequences.
(another_hunk): Parse the "0,0" instead of comparing it literally,
since there can be blanks around the comma.
* tests/Makefile.am (TESTS): Add unusual-blanks.
* tests/unusual-blanks: New file.
2024-09-15 22:50:38 -07:00
Paul Eggert
e3819470dc Update NEWS, README-prereq 2024-08-28 23:13:44 -07:00
Paul Eggert
d18c05d5bd Update copyright notices
Switch to single intervals for FSF notices,
and consistently put them first.
Update copyright notices for 2024.
* cfg.mk (update-copyright-env): Use UPDATE_COPYRIGHT_FORCE=1,
UPDATE_COPYRIGHT_USE_INTERVALS=2.
* patch.man: Always use \(co, so that update-copyright
updates these dates.
* src/version.c: Correct Larry Wall copyright years.
2024-08-28 23:13:44 -07:00
Paul Eggert
8c27a03b2e Spelling fixes 2024-08-25 18:14:30 -07:00
Andreas Gruenbacher
40b387de08 Version 2.7.6
* NEWS: Update.
2018-02-03 19:43:57 +01:00
Andreas Gruenbacher
3b698ab6a1 Version 2.7.5
* NEWS: Update.
2015-03-07 01:32:27 +01:00
Andreas Gruenbacher
de89dde09e Upate NEWS 2015-01-31 22:14:01 +01:00
Andreas Gruenbacher
41688ad8ef Fix the fix for CVE-2015-1196
* src/util.c (filename_is_safe): New function split off from name_is_valid().
(symlink_target_is_valid): Explain why we cannot have absolute symlinks or
symlinks with ".." components for now.
(move_file): Move absolute filename check here and explain.
* tests/symlinks: Put test case with ".." symlink in comments for now.
* NEWS: Add CVE number.
2015-01-22 21:51:51 +01:00
Andreas Gruenbacher
4e9269a5fc Make sure symlinks don't point outside working directory (CVE-2015-119)
When creating symlinks from git-style patches, make sure the symlinks don't
point above the current working directory.  Otherwise, a subsequent patch could
use the symlink to write outside the working directory.

* src/pch.c (symlink_target_is_valid): New function to check for valid symlink
targets.
* src/util.c (move_file): Use symlink_target_is_valid() here.
* tests/symlinks: Add valid and invalid symlink test cases.
2015-01-19 23:18:30 +01:00
Andreas Gruenbacher
f926295f4f Improve error message when refusing to delete file
* src/patch.c: Improve error message.
* tests/create-delete: Update the test case.
2014-08-13 01:16:44 +02:00
Steven Rostedt
a2f4bfe0f3 Preserve function names in reject files
* src/patch.c (main): Preserve function names in reject files.
* tests/reject-format: Update the test case.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com>
2013-08-19 22:44:46 +02:00
Andreas Gruenbacher
bbb840edca Version 2.7.1 2012-09-28 18:39:33 +02:00
Andreas Gruenbacher
c9de555284 Trailing whitespace fix
* NEWS: Trailing whitespace fix.
2012-09-28 12:43:42 +02:00
Andreas Gruenbacher
e8bfce6547 Improve the previous commit
* src/patch.c: Only print the "file is not empty after patch" message when
trying to delete the output file.  Say that we were trying to delete the file.
* tests/create-delete: Fix the expected messages.  Add test cases for the
--remove-empty-files and --posix options.
* NEWS: Better describe this change.
2012-09-26 01:33:22 +02:00
Andreas Gruenbacher
1d9ed51e9c Only expect files to become empty if the patch says so
Test cases based on patches from Dmitry V. Levin <ldv@altlinux.org>.
* src/patch.c (main): Only expect files to become empty if the patch says so.
* NEWS: Document this change.
* tests/create-delete: Add (more) empty vs. non-empty test cases.
2012-09-25 04:07:53 +02:00
Andreas Gruenbacher
89e5f702eb Update NEWS
* NEWS: Update.
2012-09-22 20:34:53 +02:00
Andreas Gruenbacher
474bb7d333 Add note on GPLv3 license change in version 2.6
* NEWS: Add note.
2012-09-13 14:38:38 +02:00
Andreas Gruenbacher
58ec5b5643 Version 2.7
* NEWS: Update.
2012-09-12 11:35:43 +02:00
Andreas Gruenbacher
66aeedee12 Support double-quoted filenames in all context diff formats
* src/util.c (fetchname): Always recognize double-quoted filenames.
* src/util.h (fetchname): Update prototype.
* src/pch.c (intuit_diff_type): Update calls to fetchname().
* tests/quoted-filenames: Change to a normal unified diff.
* NEWS: Update.
2012-08-11 11:09:11 +02:00
Andreas Gruenbacher
e0a7877a6e Update NEWS
* NEWS: Update.
2012-04-17 16:48:19 +02:00
Jim Meyering
2d38b11799 maint: update all copyright year number ranges
Run "make update-copyright".
2012-01-01 10:26:02 +01:00
Jim Meyering
4e595c3b6d give a diagnostic rather than a failed assertion for a mangled patch
* src/pch.c (another_hunk): Rather than asserting(C), issue the
"replacement text or line numbers mangled ..." diagnostic when !C.
* tests/mangled-numbers-abort: New test for the above.
* tests/Makefile.am (TESTS): Add it.
* NEWS: Mention it.
Reported by Gabriel Vlasiu via Tim Waugh.
See also http://bugzilla.redhat.com/738959
2011-10-11 03:31:57 +02:00
Jim Meyering
db2fb7cdba maint: update copyright date year ranges to include 2011
* bootstrap.conf (gnulib_modules): Add update-copyright.
Run "make update-copyright".
2011-03-27 09:16:46 +02:00
Andreas Gruenbacher
f663762bf0 Ignore dangerous filenames instead of failing immediately
* src/pch.c (name_is_valid): New function.
(intuit_diff_type, best_name): Use name_is_valid() here.
(strip_leading_slashes): Remove name validation tests from here.
* tests/bad-filenames: Add more tests for covering more of the
file name guessing corner cases in intuit_diff_type(), update the
existing tests.
* NEWS: Update.
2011-02-16 12:01:19 +01:00
Jim Meyering
4c3004c17f doc: mention the fix for CVE-2010-4651
* NEWS: Mention the fix.
2011-02-03 23:08:03 +01:00
Andreas Gruenbacher
3e234c40d2 Only recognize quited filename in the "diff --git" format
* src/util.c: Add a maybe_quoted parameter to fetchname.
* src/pch.c: Only recognize quited filename in the "diff --git"
format, at least for now.
* tests/quoted-filenames: Update accordingly.
* NEWS: Update accordingly.
2010-10-05 19:21:35 +02:00
Andreas Gruenbacher
7e6d1e6718 Document that "diff --git" criss-cross renames don't work
* NEWS: Document that "diff --git" criss-cross renames are broken
still.
* tests/criss-cross: Test case currently expected to fail.
2010-09-17 13:16:08 +02:00
Andreas Gruenbacher
47622c1e46 * NEWS: Update.
* gnulib: Update to latest.
* bootstrap: Update from gnulib.
2010-05-02 12:43:45 +02:00
Andreas Gruenbacher
3288f660a0 Document the recent changes
* patch.man: Describe the fixed behavior of --set-time and --set-utc
for timestamps that include time zones.
* NEWS: Update.
2010-04-23 21:43:45 +02:00
Andreas Gruenbacher
018ff72892 * NEWS: Version 2.6.1 released. 2009-12-30 16:30:44 +01:00
Andreas Gruenbacher
8cc8b7061c * src/patch.c (longopts, get_some_switches): Add an optional argument
to the --merge option to choose the output formats for conflicts.
* patch.man: Document the new optional argument of --merge.
* src/merge.c (merge_hunk): Implement diff3-style conflicts.
* src/common.h (conflict_style): This global variable determines the
output format for conflicts.
* tests/merge: Add test cases for the diff3 output format.
2009-12-29 17:03:14 +01:00
Andreas Gruenbacher
f01f28263e Version 2.6 released 2009-11-13 15:10:28 +01:00
Andreas Gruenbacher
62d03acb14 The -m option hasn't been officially allocated yet; use only the long form for now (--merge) 2009-07-19 17:50:54 +02:00
Andreas Gruenbacher
917aa4f4f1 When the file to patch is specified on the command line, apply all patches to that file 2009-05-12 21:55:35 +02:00
Vincent Legoll
b008dece18 Change the default value of PATCH_GET to 0
Patch should default to not try to get files from revision control software
unless actively asked by the user with the "-g" or "--get" command-line
switches, or the PATCH_GET environment variable.

Make the posixly correct behaviour of not using source control, the global
patch default. I.e. default to "-g0".

This is related to debian BTS bug: #200895
Please refer to that discussion for more background
information and discussion.
2009-05-12 14:32:15 +02:00
Andreas Gruenbacher
b7a82a44b8 Update NEWS 2009-04-07 02:12:46 +02:00
Andreas Gruenbacher
c7d14511bf Phrase things a little better 2009-04-06 16:54:28 +02:00
Andreas Gruenbacher
a03f22893c Copyright notice updates 2009-04-05 21:12:30 +02:00
Andreas Gruenbacher
802b26e78d Revert (almost) to the original asymmetric hunk behavior and document that 2009-04-05 20:24:04 +02:00
Andreas Gruenbacher
1ce9b303ce If an asymmmetric hunk starts at a line > 1, it is not from the start of the file 2009-04-03 22:28:38 +02:00
Andreas Gruenbacher
a3b6c4bbe6 Update the NEWS file 2009-04-03 11:18:47 +02:00
Andreas Gruenbacher
df890caf03 Prepare for second alpha release
Update NEWS.
Packaging and various other minor fixes.
2009-03-29 00:59:26 +01:00
Andreas Gruenbacher
b85f4543b4 When conforming to POSIX and no filename was given or found, ask 2009-03-22 22:32:04 +01:00
Andreas Gruenbacher
7efe74a605 More NEWS. 2009-03-22 16:00:29 +01:00