1
2009-11-12 Andreas Gruenbacher <agruen@suse.de>
3
* NEWS: Version 2.6 released.
5
2009-10-27 Andreas Gruenbacher <agruen@suse.de>
7
* patch.man: Fix typo (reported by Vytautas Šaltenis).
9
* src/merge.c: Clarify the message when (part of) a hunk cannot be
11
* tests/merge: Adapt the test case.
13
2009-09-04 Andreas Gruenbacher <agruen@suse.de>
15
* Makefile.in (LIBSRCS, LIBHDRS, LIBM4FILES): Add the gnulib which
16
were imported on 2009-06-05 here as well.
18
* src/partime.c (main): Try to preserve the owning group of patched
21
2009-07-19 Andreas Gruenbacher <agruen@suse.de>
23
* gl/lib/full-write.c, gl/lib/safe-write.c, gl/lib/full-write.h,
24
gl/lib/safe-write.h, gl/m4/safe-write.m4, gl/m4/ssize_t.m4:
25
Import full_write() and its prerequesites from gnulib.
26
* Makefile.in (LIBSRCS, LIBHDRS, LIBM4FILES): Add new files.
28
* configure.ac (gl_SAFE_WRITE): Needef for full_write().
29
* src/util.c: Include full-write.h.
30
(copy_to_fd): use full_write() instead of write().
32
* src/partime.c: The -m option hasn't been officially allocated yet.
33
Use only the long form for now (--merge).
35
2009-06-15 Andreas Gruenbacher <agruen@suse.de>
37
* src/util.c (move_file): Don't fail when removing nonexistent
38
files: this condition is already checked in maybe_reverse().
40
2009-06-05 Andreas Gruenbacher <agruen@suse.de>
42
* gl/lib/getopt_int.h, gl/lib/strndup.c, gl/m4/strndup.m4: Add
43
some missing gnulib files.
44
* Makefile.in (GETOPT_H): Include subdirectory (gl/lib/) when
45
using the gnulib version.
47
* src/patch.c: When sending output to stdout, use dup2 to redirect
48
messages to stderr; simply assigning stderr to stdout doesn't work on
50
* gl/lib/dup2.c, gl/m4/dup2.m4: Import from gnulib.
52
* gl/lib/rename.c, gl/m4/rename.m4: Import from gnulib for platforms
55
2009-05-12 Andreas Gruenbacher <agruen@suse.de>
57
* src/merge.c (locate_merge): Make sure to return a line number
58
bigger than last_frozen_line.
60
* src/patch.c (explicit_inname): New variable.
61
(get_some_switches): Set to true when the filename to patch has been
62
specified on the command line.
63
(reinitialize_almost_everything): Do not reset the input filename
64
between patches when it has been specified on the command line.
65
* tests/inname: New test case.
66
* Makefile.in: Add test case.
68
2009-04-11 Vincent Legoll <vincent.legoll@gmail.com>
70
* src/patch.c (main): Always set patch_get to 0 unless PATCH_GET is
72
* patch.man: Update accordingly.
74
2009-04-11 Andreas Gruenbacher <agruen@suse.de>
76
* update-version.sh, configure.ac, Makefile.in: Portability
79
2009-04-08 Andreas Gruenbacher <agruen@suse.de>
81
* src/patch.c (create_output_file): Add support for sending output
83
(main): Allow -o -. Remove redundant check.
84
* patch.man: Document the new use of -o.
86
* src/pch.c (there_is_another_patch): Allow special characters in
87
filenames read interactively.
89
* src/util.c (fetchname): Don't forget to NUL terminate ptimestr.
91
2009-04-07 Andreas Gruenbacher <agruen@suse.de>
93
* src/util.c (file_id_hasher): Adapt to Gnulib type change.
94
* Makefile.in: Fix out-of-tree builds.
95
(dist): Optionally also create bzip2 and xz tarballs.
98
* patch.man: Replace "systems like DOS" with "Windows". Spelling.
100
Preserve timestamps in reject files.
101
* src/pch.c (p_timestr): New variable.
102
(intuit_diff_type): Set p_timestr here through fetchname().
103
(pch_timestr): New function.
104
* src/pch.h (pch_timestr): Declare.
105
* src/util.c (fetchname): Return the timestamp as string when asked to.
106
* src/util.h (fetchname): Update declaration.
107
* tests/preserve-c-function-names, tests/reject-format: Update.
109
2009-04-06 Andreas Gruenbacher <agruen@suse.de>
111
Fix the "patch would create" fix from 2009-03-28.
112
* src/pch.c (maybe_reverse): New function.
113
(intuit_diff_type): Move the check back here from
114
there_is_another_patch(), but compute it using maybe_reverse(). If
115
an input file name has been specified, do this check here as well.
116
* src/patch.c (main): Only set outname if we are not skipping the
118
* src/inp.c (get_input_file): We may get here without a file to read
119
as well now; don't abort in this case.
120
* tests/create-delete: Add test cases covering the previously-broken
123
* Makefile.in (MISC): Add config.guess and config.sub.
125
* src/partime.c (parse_pattern_letter): Fix for timestamps with
126
seconds > 59.5 from Christian Franke.
128
2009-04-05 Andreas Gruenbacher <agruen@suse.de>
130
* util.c (create_backup): We also need to create base directories
131
with a --prefix without slashes and a filename with slashes. A
132
--suffix cannot contain slashes, though.
133
* merge.c (merge_hunk): Add missing outstate->zero_output = false.
135
Move all source and header files into src/.
136
* Makefile.in, tests/test-lib.sh, configure.ac: Update accordingly.
137
Move all Gnulib files below gl/, and all other source and header
139
* Makefile.in, tests/test-lib.sh, configure.ac, autogen.sh: Update
141
* m4/st_mtim.m4: Remove (obsolete since 2009-03-28).
143
Update to the latest version of Gnulib.
144
* config.guess, config.sub, gl/lib/getopt.hin, gl/lib/mbrtowc.c,
145
gl/lib/stripslash.c, gl/lib/verify.h, gl/lib/xstrndup.c,
146
gl/lib/xstrndup.h, gl/m4/argmatch.m4, gl/m4/double-slash-root.m4,
147
gl/m4/gettext.m4, gl/m4/inline.m4, gl/m4/minmax.m4,
148
gl/m4/xstrndup.m4: New files.
149
* gl/lib/argmatch.c, gl/lib/argmatch.h, gl/lib/backupfile.c,
150
gl/lib/backupfile.h, gl/lib/basename.c, gl/lib/dirname.c,
151
gl/lib/dirname.h, gl/lib/error.c, gl/lib/error.h, gl/lib/exitfail.c,
152
gl/lib/exitfail.h, gl/lib/getopt.c, gl/lib/getopt1.c, gl/lib/gettext.h,
153
gl/lib/hash.c, gl/lib/hash.h, gl/lib/malloc.c, gl/lib/memchr.c,
154
gl/lib/quote.c, gl/lib/quote.h, gl/lib/quotearg.c, gl/lib/quotearg.h,
155
gl/lib/realloc.c, gl/lib/strcasecmp.c, gl/lib/strncasecmp.c,
156
gl/lib/unlocked-io.h, gl/lib/xalloc.h, gl/lib/xmalloc.c: Modified.
157
* gl/m4/backupfile.m4, gl/m4/d-ino.m4, gl/m4/dirname.m4, gl/m4/dos.m4,
158
gl/m4/error.m4, gl/m4/exitfail.m4, gl/m4/extensions.m4,
159
gl/m4/getopt.m4, gl/m4/hash.m4, gl/m4/malloc.m4, gl/m4/mbrtowc.m4,
160
gl/m4/mbstate_t.m4, gl/m4/memchr.m4, gl/m4/onceonly.m4, gl/m4/quote.m4,
161
gl/m4/quotearg.m4, gl/m4/realloc.m4, gl/m4/stdbool.m4,
162
gl/m4/unlocked-io.m4, gl/m4/utimbuf.m4, gl/m4/xalloc.m4: Likewise.
163
* install-sh, mkinstalldirs: Likewise.
164
* gl/lib/stdbool.hin: Renamed from gl/lib/stdbool_.h.
165
* gl/lib/getopt.h: Removed (should be generated).
166
* gl/lib/addext.c: Removed from Gnulib.
168
Replace memory_fatal() with xalloc_die(). The FILESYSTEM_PREFIX_LEN()
169
macro has been renamed to FILE_SYSTEM_PREFIX_LEN().
170
* src/patch.c (main): Remove xalloc_fail_func (replaced by
171
xalloc_die()). Work around the missing addext() with
172
find_backup_file_name() plus hacks.
173
* src/util.c (create_backup, version_controller): The new versions of
174
base_name() and dir_name() return malloc'ed buffers. Adapt.
175
* src/util.h: Replace memory_fatal() with xalloc_die().
176
* src/pch.c: Don't leak memory with strlen (base_name (...)).
178
* src/util.c (create_file): Add to_dir_known_to_exist argument and
179
try to create parent directories when set and the create failed with
181
(copy_file, create_backup_copy): Pass the new to_dir_known_to_exist
183
(create_backup): Don't assume the target directory exists when making
185
* src/util.h (create_file, copy_file): Change the declarations.
186
* src/patch.c, src/pch.c, src/inp.c: In the calls to create_file() and
187
copy_file(), assume the parent directory exists.
188
* tests/unmodified-files: Test the create_backup() fix.
190
* src/util.c (create_backup): The new dir_name() and base_name()
191
functions are really counter productive. Remove them and the bugs
192
that keepeing them here as introduced.
193
* tests/backup-prefix-suffix: Add more regression tests.
195
* src/patch.c (locate_hunk): Revert to the original asymmetric hunk
196
behavior (but only anchor hunks starting at line 0 to the start of the
197
file): there is not enough reason to change the historic behavior.
198
* src/merge.c (locate_merge): Add similar asymmetric hunk check here.
199
* tests/asymmetric-hunks: Update accordingly.
200
* patch.man: Document the asymmetric hunk behavior.
203
Copyright notice updates.
204
* README, AUTHORS: Updates.
206
* patch.man: Document that merging can be slow.
207
* tests/test-lib.sh: Also unset QUOTING_STYLE.
209
2009-04-04 Andreas Gruenbacher <agruen@suse.de>
211
* pch.c (another_hunk): Add (back) the line number ranges to the
213
* merge.c (merge_hunk): Likewise.
214
(locate_merge): Add a note about the algorithm's requirements.
215
* util.c (create_backup): Split from move_file. New LEAVE_ORIGINAL
216
argument for copying instead of renaming. Don't fail when rename
217
fails with errno == EXDEV; copy and unlink in that case instead.
218
(copy_file): Add debug message.
219
* util.h: Move including <utime.h> etc. here from patch.c.
220
(create_backup): Declare.
221
* patch.c (main): Create backup files even for files which did not
222
actually change; some users of patch rely on the presence of backup
223
files when patch says "patching file".
224
* tests/unmodified-files: Test the patch.c change. (The EXDEV fix in
225
create_mackup() was tested manually.)
226
* util.c (copy_to_fd, ask): The read() return type is ssize_t.
228
2009-04-03 Andreas Gruenbacher <agruen@suse.de>
230
* patch.man: Document the -m or --merge option. Some minor other
232
* NEWS: Document the asymmetric hunk behavior and the -m or --merge
234
* merge.c (locate_merge): Include the number of changes in the debug
236
(print_linerange): New function.
237
(merge_result): No longer print line offsets: without exact matches,
238
line numbers are less meaningful. Output the entire messages here.
239
(merge_hunk): Be silent when merging exact matches unless in
241
* tests/merge: Add another interesting test case.
243
* tests/test-lib.sh: Add have_ed function for checking if ed is
245
* tests/crlf-handling, tests/need-filename: Check for ed and skip the
246
ed related tests if we don't have it.
247
* tests/merge: Use sed instead of ed: sed is more readily available.
249
* patch.c (locate_hunk): If a hunk starts at a line > 1, it obviously
250
is not from the start of the file.
251
* tests/asymmetric-hunks: Add tests for all possible cases.
253
2009-04-02 Andreas Gruenbacher <agruen@suse.de>
255
* patch.c (locate_hunk): Revert the assymmetric hunk fix from
256
2009-03-29. Instead, allow such hunks to apply only when no
257
more context remains.
259
* patch.c (main): Restructure to get rid of some code duplication.
260
(copy_till, similar): Export these functions.
261
* common.h (struct outstate, in_offset, out_offset,
262
last_frozen_line): Move here from patch.c.
263
(apply_hunk, copy_till, similar): Declare here.
265
Simple merge support:
266
* configure.ac (ENABLE_MERGE): New --disable-merge option.
267
* patch.c (merge): New variable.
268
(main): New -m and --merge options. When in merge mode, don't try
269
to reverse patches, and don't try to apply with fuzz.
270
* common.h (merge_hunk): Declare function.
271
* merge.c: New file containing all the merge code.
272
* tests/merge: New test case.
273
* Makefile.in (SRCS): Add merge.c.
274
(OBJS): Add merge.$(OBJEXT) when merge support is enabled.
275
(TESTS): Add test case.
276
(COMPILE): Define ENABLE_MERGE when merge support is enabled.
278
Locate hunks to merge more intelligently:
279
* bestmatch.h: Shortest Edit Sequence algorithm.
280
* merge.c (locate_merge, count_fuzz_lines): New functions.
281
(merge_hunk): Replace simple guessing with locate_merge().
282
* Makefile.in (HDRS): Add bestmatch.h.
283
* tests/merge: Only minor improvements up to now.
285
* diffseq.h: New file (Gnulib compareseq algorithm).
286
* minmax.h: New file (Gnulib MIN and MAX macros).
287
* Makefile.in (HDRS): Add diffseq.h and minmax.h.
289
* COPYING: Update to GPL version 3 because of diffseq.h.
291
* diffseq.h: When an EQUAL_IDX macro is defined, use that instead
292
of EQUAL. This macro takes vector indexes instead of elements as
295
Better merge support:
296
* patch.c, common.h (apply_hunk): Make static again.
297
* merge.c (compute_changes): New function for computing the
298
difference between lines in a hunk and lines in the input file.
299
(merge_result): We may have more than one result per hunk now.
300
(merge_hunk): Merge the hunk with the compute_changes() result.
301
* tests/merge: Better results now.
303
* merge.c: Add license header.
305
* merge.c (locate_merge): The number of changes allowed permits a
306
higher maximum merge position (max_where).
307
* tests/merge: Add a test for this case.
309
* merge.c (merge_hunk): Add two missing checks that were leading into
311
* tests/merge: Add test cases for each of these checks.
313
* Makefile.in (install, uninstall): DESTDIR specifies a prefix to
314
the root directory to install into.
315
(installdirs): Merge with install.
317
2009-04-01 Andreas Gruenbacher <agruen@suse.de>
319
* tests/test-lib.sh: When $GDB is set, run patch in gdbserver
321
* pch.c (another_hunk): Make the debug output easier to read.
323
2009-03-31 Andreas Gruenbacher <agruen@suse.de>
325
* patch.c: Split last_offset into in_offset and out_offset and
326
count line numbers properly.
327
* tests/line-numbers: Without the fixes, this test case goes
329
* Makefile.in (TESTS): Add test case.
331
2009-03-30 Jim Meyering <meyering@redhat.com>
333
tests: accommodate ls' "alternate access control method" indicator
334
ls can output an additional byte after a file's permissions string,
335
e.g., rather than "rwxr--r-- ..." it can output "rwxr--r--+ ..."
336
or "rwxr--r--. ..." to indicate the presence of an ACL.
337
* tests/create-delete: Adjust sed filter to accommodate that.
338
* tests/preserve-mode-and-timestamp: Likewise.
340
2009-03-30 Andreas Gruenbacher <agruen@suse.de>
342
* tests/test-lib.sh: Unset environment variables that influence
343
the behavior of patch.
344
* util.c (move_file): Add debug message when files have been seen
345
already. Fix leftover "empty uneadable" debug message.
347
* patch.c (main): Print newline earlier.
348
* util.c (copy_file): Add debug message.
350
2009-03-29 Andreas Gruenbacher <agruen@suse.de>
352
* patch.c (locate_hunk): Hunks that have fewer or more lines of
353
context at the beginning than at the end can match anywhere; the
354
assumption that this can only occur at the beginning or end of the
355
file is wrong. Remove those checks.
356
* tests/asymmetric-hunks: New test case.
357
* Makefile.in (TESTS): Add test case.
359
* util.c (move_file): Create backup files of nonexisting files with
360
the default mode instead of mode 0: files with mode 0 cause too many
361
problems with applications which do not expect unreadable files.
362
* tests/create-delete: Test for this.
364
* Makefile.in (BROKEN_TESTS): Test cases which fail.
366
2009-03-28 Andreas Gruenbacher <agruen@suse.de>
368
* pch.c (intuit_diff_type): Rename need_filename argument to
369
need_header. Omit superfluous "missing header" warnings.
371
When remembering files including timestamps, we need to update the
372
timestamps after appending to a file. This causes problems on some
373
systems where the timestamps returned by fstat() after appending are
374
not up to date, yes. We only remember timestamps as a compatibility
375
hack with non-POSIX systems that do not have unique inode numbers;
376
drop this hack instead.
377
* timespec.h, m4/timespec.m4: Remove.
378
* util.c: Remove timespec.h and all uses of struct timespec.
379
(append_to_file): Remove REMEMBER argument; no need to update known
381
* util.h (append_to_file): Update definition.
382
* Makefile.in: Remove timespec.h and m4/timespec.m4.
384
* common.h (origsuff): New variable.
385
* patch.c (main): Remember when -z was used.
386
* util.c (contains_slash): New function.
387
(move_file): Enforce simple backup mode and compute the backup file
388
name here if -B, -Y, or -z is used. Fix the case where -B or -Y is
390
* patch.man: Document this change.
391
* tests/backup-prefix-suffix: New test case.
392
* Makefile.in (TESTS): Add test case.
394
* tests/munged-context-format: New test case.
395
* Makefile.in (TESTS): Add test case.
397
* util.c (vsay): New function for use in say(), etc.
398
(ok_to_reverse): Use vsay() here instead of fprintf() to ensure
401
* pch.c (there_is_another_patch): Move the "patch would create" test
402
here from intuit_diff_type() after asking for the filename to patch.
403
* inp.c (get_input_file): No need to report when the file is missing;
404
this is done in there_is_another_patch() already.
405
* patch.c (main): No need to report when a patch attempts to create
406
an exiting file, either.
408
2009-03-25 Andreas Gruenbacher <agruen@suse.de>
410
* patch.c (main): Avoid replacing files when nothing has changed.
411
* tests/unmodified-files: New test case.
412
* Makefile.in (TESTS): Add test case.
414
* patch.c (main): New apply_empty_patch variable. When applying an
415
empty patch to a file and -o is given, copy the input file to the
418
2009-03-24 Andreas Gruenbacher <agruen@suse.de>
420
* patch.c (abort_hunk_unified, abort_hunk_context): Preserve
421
Index lines in reject files as well.
422
* tests/reject-format: Test this change.
424
* configure.ac (TEST_SHELL): New substitution.
425
* Makefile.in (TEST_SHELL): New variable.
426
(HAVE__BOOL): New variable.
427
(hash.$(OBJEXT)): Add $(STDBOOL_H) dependency.
428
* tests/test-lib.sh: Use expr for arithmetic operations. Check for
429
working "echo -n" and BASH_LINENO. Replace printf with echo.
430
* tests/preserve-mode-and-timestamp: Ignore leading "+" in ls output.
431
* tests: Remove !shebang line from tests and make them non-executable.
432
Replace printf with echo.
434
2009-03-23 Andreas Gruenbacher <agruen@suse.de>
436
* patch.c (intuit_diff_type): When looking for an ed or normal
437
patch, don't look for filename headers. (Those formats don't
439
* pch.c (there_is_another_patch): Don't suggest to use -p with
440
normal format diffs for the same reason.
442
2009-03-22 Andreas Gruenbacher <agruen@suse.de>
444
* NEWS: Update for alpha release.
446
* patch.c (main): Always initialize the known files table.
447
Move new reject files into place; append to known ones.
448
* util.c (file_already_seen): Export.
449
(move_file): Remember all files, not only backup files.
450
(append_to_file): When asked to remember a file, remember
451
the state *after* appending. (The timestamps will change!)
452
* tests/remember-reject-files: New test case.
453
* Makefile.in (TESTS): Add test case.
455
* common.h (no_strip_trailing_cr): New variable.
456
* patch.c: Use no_strip_trailing_cr. Option --binary no longer
457
a no-op on POSIX systems.
458
* patch.man: Document change of --binary.
459
* pch.c (there_is_another_patch): Check no_strip_trailing_cr.
460
* tests/crlf-handling: Add --binary tests here.
462
* patch.c (apply_hunk): Use fputs() in simple fprintf()
465
* patch.c (main): Require filename in patch if none specified on
466
the command line and posixly_correct is false.
467
* pch.c (intuit_diff_type): While we still don't have a filename,
468
don't look for hunks.
469
(there_is_another_patch): Pass need_filename through.
470
* tests/need-filename: New test case.
471
* Makefile.in (TESTS): Add test case.
473
* pch.c (intuit_diff_type): Check for garbage after what looks
474
like a normal format command.
475
* tests/normal-garbage: New test case.
476
* Makefile.in (TESTS): Add test case.
478
* Makefile.in (bindir): Define as @bindir@.
479
(DISTFILES_CLEAN): Move DISTFILES here which must not be remade by
481
(MISC): Add missing tests/test-lib.sh and update-version.sh.
482
(check, $(TESTS)): Make each test depend on all so that they can be
484
(maintainer-clean): Also remove patch-*.tar.gz and patch-*.tar.gz.sig.
485
(dist): Add PV directory level. Add reminder to self how to upload.
486
* configure.ac: Silence "missing datarootdir" warning.
488
* tests/crlf-handling: Add test for "diff -p" context with a CRLF
491
2009-03-21 Andreas Gruenbacher <agruen@suse.de>
493
* patch.c (main): With -r, instead of moving the global reject
494
file into place, copy the first reject into the file, and
495
append all the rest. Discard rejects with -r -.
496
* patch.man: Document the latter.
497
* util.c (copy_to_fd): New function.
498
(copy_file): Use that.
499
(append_to_file): New function.
500
* util.h (append_to_file): Add function declaration.
501
* tests/global-reject-files: New test case.
502
* Makefile.in (TESTS): Add test case.
504
* patch.man: Minor fix.
506
* pch.c (another_hunk, pch_swap): Always add the '^' hunk end
507
marker: apply_hunk() and abort_hunk_unified() rely on it.
508
(pch_char): Explain when this returns '\n'.
509
* util.c: Remove unused include <version.h>.
511
2009-03-20 Andreas Gruenbacher <agruen@suse.de>
513
* patch.c: New option --reject-format=FORMAT.
514
(abort_hunk_context): Rename from abort_hunk().
515
(abort_hunk_unified, abort_hunk, mangled_patch,
516
print_unidiff_range): New functions.
517
* patch.man: Document this.
518
* pch.c, pch.h (pch_normalize): New function.
519
* tests/reject-format: New test case.
520
* Makefile.in (TESTS): Add test case.
521
* tests/preserve-c-function-names: Update.
523
* pch.c (p_name): New variable.
524
(intuit_diff_type): Save the old, new, and index filenames.
525
(pch_char): Return either of the saved filenames.
526
* pch.h: Move enum nametype here from pch.c. Declare pch_name().
527
* patch.c (abort_hunk, abort_hunk_unified, abort_hunk_context):
528
New HEADER and REVERSE arguments.
529
(print_header_line): New function.
530
(abort_hunk_unified, abort_hunk_context): Use it.
531
* tests/corrupt-reject-files, tests/preserve-c-function-names,
532
tests/reject-format: Update.
534
* patch.c (main): No longer set reject file modes to the modes of the
535
files they are assiciated with: the previous behavior is inconsistent
536
with global reject files (-r), which are not associated with any
538
* tests/preserve-mode-and-timestamp: New test case.
539
* Makefile.in (TESTS): Add test case.
541
* Makefile.in (DISTFILES): Add the files from DISTFILES_M4,
542
DISTFILES_PC, DISTFILES_PC_DJGPP.
543
(DISTFILES_M4, DISTFILES_PC, DISTFILES_PC_DJGPP): Remove.
544
(distclean): Also remove config.hin~ and autom4te.cache/.
545
(maintainer-clean): Also remove aclocal.m4, config.hin, configure.
546
(dist): Make work for DISTFILES in subdirectories. Normalize and
549
* Makefile.in (MISC): Add VERSION.
551
(VERSION): Recompute automatically from repository.
552
(configure): Depend on VERSION. Regenerate with --force: autoconf
553
does not recognize the dependency between VERSION and ocnfigure.
554
(config.hin): Regenerate with --force.
555
(maintainer-clean): Also remove VERSION.
556
* configure.ac: Compute PACKAGE_VERSION from repository.
557
* update-version.sh: New file.
559
* README-alpha: New file.
560
* Makefile.in (dist): Add README-alpha when appropriate.
562
* Makefile.in (M4FILES): Rename from ACINCLUDE_INPUTS.
563
(aclocal.m4): Recompute with aclocal.
565
* tests/test-lib.sh: Add library for simple test scripts.
566
* tests/crlf-handling, tests/remember-backup-files: New test cases.
567
* Makefile.in (TESTS): New variable. Add test cases.
568
(check): Replace the dummy test target with running all TESTS.
570
* pch.c, pch.h (pch_c_function): New function.
571
* pch.c (p_c_function): New variable.
572
(another_hunk): Preserve the "diff -p" output.
573
* patch.c (abort_hunk): Use pch_c_function().
574
* tests/preserve-c-function-names: New test case.
575
* Makefile.in (TESTS): Add test case.
577
* util.c (savebuf): Return NULL if size == 0.
578
* pch.c (another_hunk): Check size for size != 0 before checking
579
savebuf()'s return value.
580
* tests/no-newline-triggers-assert: New test case.
581
* Makefile.in (TESTS): Add test case.
583
* tests/corrupt-reject-files: new test case for Jim Meyering's
585
* Makefile.in (TESTS): Add test case.
587
2009-03-19 Andreas Gruenbacher <agruen@suse.de>
589
Imported from Paul Eggert's working directory:
590
* exitfail.c, exitfail, m4/exitfail.m4: Import from gnulib.
591
* hash.c, hash.h, m4/hash.m4: Likewise.
592
* m4/extensions.m4: Likewise.
593
* timespec.h, m4/timespec.m4: Likewise.
594
* m4/st_mtim.m4: New file.
595
* configure.ac: Update.
596
* common.h: Include <limits.h> unconditionally. Include <stdint.h>
598
* inp.c (plan_b, ifetch): Remove unnecessary casts.
599
* maketime.c, partime.c: Include <limits.h>, <stdlib.h>, <time.h>
600
unconditionally. Convert from K&R to ANSI C.
601
* maketime.h, partime.h: Convert from K&R to ANSI C.
602
* pch.c (p_indent, pget_line, intuit_diff_type): Use size_t for
604
* util.c: Assume we have vfprintf().
605
(NUM_SIGS): Cast to int in.
606
(fatal_exit_handler): Replace obsolescent AC_RETSIGTYPE.
607
* Various files: Update copyright notices.
609
2007-08-26 Jim Meyering <jim@meyering.net>
611
* pch.c (another_hunk): Avoid an off-by-one error that would
612
result in NUL bytes in .rej files.
614
2004-07-21 Paul Eggert <eggert@twinsun.com>
616
* Makefile.in (SRCS): Move hash.c here from LIBSRCS.
617
(exitfail.$(OBJEXT), patch.$(OBJEXT), xmalloc.$(OBJEXT)):
618
Depend on exitfail.h.
619
(hash.$(OBJEXT), util.$(OBJEXT)): Depend on hash.h.
620
* util.c: Whitespace cleanup in file_id.
622
2004-07-19 Stepan Kasal <kasal@ucw.cz>
624
* pch.c (get_ed_command_letter): Allow commands without address.
626
2003-11-10 Manu B <manubee@users.sourceforge.net>
628
Trivial change to port to mingw, which declares mkdir in unistd.h.
629
* m4/mkdir.m4 (PATCH_FUNC_MKDIR_TAKES_ONE_ARG): Include unistd.h.
630
* common.h (mkdir): Define after including unistd.h.
632
2003-09-11 Paul Eggert <eggert@twinsun.com>
634
* pch.c (do_ed_script): Adjust to copy_file signature change.
636
* Makefile.in (STDBOOL_H): New macro. All uses of @STDBOOL_H@ changed.
637
(SRCS): Add exitfail.c.
638
(OBJS): Add exitfail.$(OBJEXT).
639
(HDRS): Add exitfail.h.
640
(stdbool.h): Use $@, as gnulib now suggests.
641
(ACINCLUDE_INPUTS): Add exitfail.m4, extensions.m4.
642
* common.h: Include <string.h>, <stdlib.h> unconditionally.
643
* configure.ac (gl_USE_SYSTEM_EXTENSIONS): Use this instead
646
* patch.c: Include exitfail.h.
647
(main): Set exit_failure, not xalloc_exit_failure.
649
* inp.c (get_input_file): Clear cs if dry run.
651
* util.c (fetchname): Handle missing timestamps better.
653
* Makefile.in (LIBSRCS): Add hash.c.
654
(OBJS): Add hash.$(OBJEXT).
656
(MISC): Add timespec.h.
657
(ACINCLUDE_INPUTS): Add hash.m4, st_mtim.m4, timespec.m4
658
(util.$(OBJEXT): Depend on timespec.h.
659
* configure.ac (gl_HASH, gl_TIMESPEC): Add.
660
* patch.c (spew_output): New output arg, to contain status of output
662
(main): Use it to get status of output file, and pass this to
663
move_file as needed. Initialize hash table.
664
* util.c (file_id): New type.
665
(file_id_hasher, file_id_comparator, init_backup_hash_table,
666
insert_file, file_already_seen): New functions.
667
(file_id_table): New var.
668
(move_file): New arg FROMST; all uses changed.
669
Do not backup a file that's already been patched.
670
Keep track of files that have been patched.
671
(copy_file): New arg TOST; all uses changed.
672
* util.h (copy_file, move_file): Adjust decls as per above.
673
(init_backup_hash_table): New decl.
676
2003-07-05 Paul Eggert <eggert@twinsun.com>
678
* Makefile.in (check): Add a trivial check that "patch --help" works.
679
From a suggestion by Ed Avis.
681
2003-07-02 Paul Eggert <eggert@twinsun.com>
683
* pch.c (intuit_diff_type): If a unified-diff header line contains
684
trailing CR, strip CR from each body line. This corrects a bug
685
introduced in the 2003-05-18 patch. Bug reported by Andreas
688
* mkdir.c, rmdir.c, m4/rmdir.m4: Remove; we no longer
689
need to worry about ancient hosts that lack these functions.
691
* addext.c, backupfile.c, backupfile.h, dirname.h, m4/backupfile.m4,
692
m4/onceonly.m4, m4/quote.m4, malloc.c, quote,c, quote.h, realloc.c,
693
strcasecmp.c, xalloc.h, xmalloc.c: Sync with gnulib.
694
* stdbool_.h: Renamed from stdbool.h.in; all uses changed.
695
This renaming is imported from gnulib.
696
* m4/strcase.m4: New file, imported from gnulib.
698
* Makefile.in (LIBSRCS): Remove mkdir.c and rmdir.c.
699
(stdbool.h): Put output into temporary file and then rename it;
700
this change is imported from gnulib.
701
(mostlyclean): Clean stdbool.h-t too.
702
(ACINCLUDE_INPUTS): Remove rmdir.m4. Add strcase.m4.
703
* configure.ac (gl_FUNC_RMDIR): Remove.
704
(jm_PREREQ_ADDEXT): Remove; now down by gl_BACKUPFILE.
705
(gl_STRCASE, gl_XALLOC): Add.
706
(AC_REPLACE_FUNCS): Remove mkdir, strcasecmp.
1
708
2003-05-20 Paul Eggert <eggert@twinsun.com>
3
710
* NEWS, configure.ac (AC_INIT): Version 2.5.9 released.