re-mark 1.29b-2 as not yet uploaded (merge madness!)
[debian/tar] / ChangeLog
1 2016-05-16  Sergey Poznyakoff  <gray@gnu.org.ua>
2
3         Version 1.29
4
5         Minor fix
6         * src/names.c (new_name): rename to make_file_name. All uses
7         changed.
8
9 2016-04-14  Sergey Poznyakoff  <gray@gnu.org.ua>
10
11         Fix argument handling when running external commands.
12         * src/system.c (xexec): Use sh -c to run the command.  This fixed
13         bug introduced by 7b5e80396 (tar 1.27)
14         * doc/tar.texi: Fix checkpoint examples: (1) $TAR_FILENAME
15         is not available when creating archive and (2) --checkpoint
16         can't be used as abbreviation of --checkpoint-action
17
18 2016-04-06  Sergey Poznyakoff  <gray@gnu.org.ua>
19
20         Remove iotty test
21         The auxiliary utility ttyemu proved to be unreliable.
22         Given existing
23         differences between pty implementations and termios ioctls
24         on various
25         platforms, writing it in a portable way requires effort
26         disproportional
27         to its actual purpose.
28         * configure.ac: Remove check for grantpt
29         * gnulib.modules: Remove posix_openpt, ptsname, and unlockpt
30         * tests/Makefile.am (TESTSUITE_AT): Remove iotty.at
31         (check_PROGRAMS): Remove ttyemu.
32         * tests/testsuite.at: Remove iotty.at
33         * tests/iotty.at: Remove.
34         * tests/ttyemu.c: Remove.
35
36 2016-04-05  Pavel Raiskup  <praiskup@redhat.com>
37
38         xattrs: fix build on Darwin
39         Be careful to define HAVE_XATTRS when not all needed xattr-related
40         functions are properly defined either in libc or libattr.
41         Reported independently by Denis Excoffier and Dominyk Tille.
42         * acinclude.m4 (TAR_HEADERS_ATTR_XATTR_H): Check for each xattr
43         function separately.  Don't AC_CHECK_LIB (LIBS is filled by
44         AC_SEARCH_LIBS when necessary).
45         * src/Makefile.am: The LDADD -lattr was redundant.
46
47 2016-03-24  Sergey Poznyakoff  <gray@gnu.org.ua>
48
49         Remove --preserve option
50         * src/tar.c: Remove --preserve option
51         * NEWS: Update.
52         * doc/tar.texi: Update.
53
54         Fix testcase
55         * tests/time02.at: Sort tar -d output
56
57         Update THANKS file
58
59 2016-03-24  Jeremy Bobbio  <lunar@debian.org>
60
61         New option --clamp-mtime
62         The new `--clamp-mtime` option will change the behavior of
63         `--mtime` to only
64         use the time specified if the file mtime is newer than the
65         given time.
66         The `--clamp-mtime` option can only be used together with
67         `--mtime`.
68         Typical use case is to make builds reproducible: to loose less
69         information, it's better to keep the original date of an archive,
70         except for
71         files modified during the build process. In that case, using
72         a reference
73         (and thus reproducible) timestamps for the latter is good
74         enough. See
75         <https://wiki.debian.org/ReproducibleBuilds> for more information.
76         Patch submitted by Jeremy Bobbio and
77         Daniel Kahn Gillmor <dkg@fifthhorseman.net>
78         * doc/tar.1: Document --clamp-mtime
79         * doc/tar.texi: Likewise.
80         * src/common.h (set_mtime_option_mode): New enum
81         (set_mtime_option): Change type to enum set_mtime_option_mode.
82         (NEWER_OPTION_INITIALIZED): Rename to NEWER_OPTION_INITIALIZED.
83         * src/create.c (start_header): Set mtime depending on
84         set_mtime_option.
85         * src/tar.c (options,parse_opt): New option --clamp-mtime
86         (decode_options): Initialize mtime_option
87         * tests/time02.at: New testcase.
88         * tests/Makefile.am: Add new testcase
89         * tests/testsuite.at: Likewise.
90
91 2016-03-21  Sergey Poznyakoff  <gray@gnu.org.ua>
92
93         Acknowledgments
94         * THANKS: Add Dagobert Michelsen
95
96         Fix the testsuite
97         * tests/sparse06.at: Don't use timeout: depending on the
98         filesystem
99         mounted, current LA and lots of other factors, creation of
100         archive can
101         take much more time than the expected 2 seconds.
102
103         Fix ckmtime
104         * gnulib.modules: Use timespec-sub
105         * tests/ckmtime.c: Use second resolution.
106
107 2016-03-20  Sergey Poznyakoff  <gray@gnu.org>
108
109         Fix the testsuite
110         * tests/sparse05.at: Use autom4te magic to generate mapfile,
111         instead of the shell command seq, which is not always available.
112         * tests/listed03.at: Skip the test if xgetcwd fails.
113         * tests/ckmtime.c: New file.
114         * tests/Makefile.am: Build ckmtime
115         * tests/testsuite.at (AT_CHECK_TIMESTAMP): Check whether newly
116         created
117         files have timestamps consistent with the creation time.
118         Skip the test
119         if not.
120         * tests/incr01.at: Use AT_CHECK_TIMESTAMP
121         * tests/incr02.at: Likewise.
122         * tests/incr03.at: Likewise.
123         * tests/incr04.at: Likewise.
124         * tests/incr05.at: Likewise.
125         * tests/incr06.at: Likewise.
126         * tests/incr07.at: Likewise.
127         * tests/incr08.at: Likewise.
128         * tests/incr09.at: Likewise.
129         * tests/incr10.at: Likewise.
130         * tests/incr11.at: Likewise.
131         * tests/incremental.at: Likewise.
132         * tests/listed01.at: Likewise.
133         * tests/listed02.at: Likewise.
134         * tests/listed04.at: Likewise.
135         * tests/listed05.at: Likewise.
136
137 2016-03-18  Sergey Poznyakoff  <gray@gnu.org.ua>
138
139         Testsuite fixes.
140         * paxutils: Update.
141         * src/unlink.c (flush_deferred_unlinks): OpenSolaris sets EEXIST
142         instead of ENOTEMPTY if trying to remove a non-empty directory.
143         * tests/numeric.at: Avoid using awk -v: some older awks don't
144         support
145         that option.  Also fix environment variable usage.
146         * tests/onetop05.at: Skip test if unable to set initial directory
147         mode bits.
148         * tests/sparse06.at: Use --quiet option.
149
150         Revise docs
151
152         Fix build with --enable-gcc-warnings
153         * configure.ac: Disable stack-protector warnings
154
155 2016-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>
156
157         Improve testsuite
158         * tests/iotty.at: Skip test if ttyemu can't do its job
159
160 2016-03-16  Sergey Poznyakoff  <gray@gnu.org.ua>
161
162         Document xattrs, ACL and SELinux-related options.
163         * doc/tar.1: Document all options.
164         * doc/tar.texi: Likewise.
165
166 2016-03-15  Sergey Poznyakoff  <gray@gnu.org.ua>
167
168         Fix appending to archive with changed blocking factor.
169         * src/buffer.c (flush_archive): If previous reading attempt
170         resulted
171         in short read, correctly use the remaining record space.
172         (backspace_output): Fix position calculation (still has to be
173         improved).
174         * tests/append05.at: New test case.
175         * tests/Makefile.am: Add new test.
176         * tests/testsuite.at: Likewise.
177
178 2016-03-14  Sergey Poznyakoff  <gray@gnu.org.ua>
179
180         Fix coredump on parsing invalid traditional option
181         * src/tar.c (find_argp_option): Fix loop termination condition.
182
183 2016-01-20  Sergey Poznyakoff  <gray@gnu.org.ua>
184
185         Update copyright years
186
187         Allow escaped delimiters in transform expressions.
188         Patch provided by Charles McGarvey and Flavio Poletti.
189         * src/transform.c (parse_transform_expr): Allow escaped delimiters
190         in transform expressions.
191         * tests/xform02.at: New test case.
192         * tests/Makefile.am: Add xform02.at
193         * tests/testsuite.at: Include xform02.at
194         * THANKS: Update.
195
196 2015-12-17  Sergey Poznyakoff  <gray@gnu.org.ua>
197
198         Fix eventual dereference of uninitialized pointer.
199         * src/exclist.c (hg_initfn): Initialize hgopt.
200
201 2015-12-17  Pavel Raiskup  <praiskup@redhat.com>
202
203         sparse: fix use of indeterminate value
204         * src/xheader.c (sparse_map_decoder): Move 'e' up from loop-block.
205
206 2015-12-11  Sergey Poznyakoff  <gray@gnu.org.ua>
207
208         fix a typo
209         * doc/tar.texi (Incremental Dumps): Add missing --file to the
210         '--list' example.
211
212         Minor fixes.
213         * doc/tar.texi: Document position-sensitive options in a
214         separate subsection.
215         * src/names.c (names_argp,names_argp_children): Explicitly
216         initialize
217         all members.
218
219 2015-12-11  Sergey Poznyakoff  <gray@gnu.org>
220
221         Minor fix
222
223         Fix handling of filename-selection options.
224         Filename-selection options are --wildcards, --recursive, etc. (see
225         names.c for a complete list).  These options are
226         position-sensitive,
227         i.e. each such option affects all filenames and filename-selection
228         options that appear after it until eventually cancelled by a
229         corresponding counterpart option.
230         These options can appear in "file-from" file lists, which
231         means that
232         they cannot be handled right away, but instead should be put on
233         the "name_elt" list and processed sequentionally, as file name
234         arguments
235         are.
236         * src/common.h (warn_regex_usage): Remove.
237         (name_add_name): Change signature.
238         (name_add_dir, name_add_file): Remove prototypes.
239         * src/names.c (name_add_option, name_add_dir)
240         (name_add_file): Static functions.
241         (names_options, is_file_selection_option, names_parse_opt):
242         Static functions.
243         (names_argp_children): New variable.
244         (NELT_NAME, NELT_CHDIR)
245         (NELT_FILE, NELT_NOOP): Redefine as enum nelt_type.
246         (NELT_FMASK): Remove.
247         (NELT_OPTION): New constant.
248         (name_elt) <type>: Change type.
249         <v.opt>: New member.
250         (name_elt_alloc_matflags): Remove.
251         (name_add_name): Take one argument.
252         (name_add_option): New static function.
253         (name_add_file): Take one argument.
254         (read_next_name): Use filename_terminator and
255         verbatim_files_from_option to initialize file.term and
256         file.verbatim.
257         * src/tar.c: Move handling of filename-selection options to
258         names.c
259         * tests/T-dir00.at: Fix typo.
260         * tests/T-recurse.at: Remove expected failure.
261
262 2015-12-10  Pavel Raiskup  <praiskup@redhat.com>
263
264         better test --{,no-}recursion options
265         * tests/recurs02.at: Also test --list mode.
266         * tests/T-recurse.at: New test case.  Test that -T option works
267         correctly together with --{,no-}recursion.
268         * tests/Makefile.am: Mention new test T-recurse.at.
269         * tests/testsuite.at: Likewise.
270
271 2015-12-06  Pavel Raiskup  <praiskup@redhat.com>
272
273         Bugfix
274         * src/buffer.c (try_new_volume): Warn if user supplied malformed
275         tar archive.
276         Consistently use WARN (instead of ERROR) when reporting.
277
278 2015-12-06  Sergey Poznyakoff  <gray@gnu.org>
279
280         Fix segfault when extracting from a multi-volume archive.
281         Fix suggested by Pavel Raiskup.
282         * src/buffer.c (try_new_volume): Fix dereferencing NULL pointer.
283         * tests/multiv09.at: New testcase.
284         * tests/Makefile.am: Add new testcase.
285         * tests/testsuite.at: Likewise.
286
287         Fix NEWS
288
289 2015-12-06  Pavel Raiskup  <praiskup@redhat.com>
290
291         numeric-owner: print big UID/GID correctly
292         * src/list.c (simple_print_header): Do not parse ustar header
293         for UID/GID again (tar_stat_info has already been correctly
294         filled with respect to possible uid/gid extended headers).
295         * tests/numeric.at: New testcase for --numeric-owner option.
296         * tests/Makefile.am: Add new testcase.
297         * tests/testsuite.at: Likewise.
298
299 2015-12-06  Sergey Poznyakoff  <gray@gnu.org.ua>
300
301         Use SEEK_HOLE for hole detection
302         Based on patch by Pavel Raiskup.
303         Use SEEK_HOLE/SEEK_DATA feature of lseek on systems that support
304         it.  This can make archiving of sparse files much faster.
305         Implement the --hole-detection option to allow users to select
306         hole-detection method.
307         * src/common.h (hole_detection_method): New enum.
308         (hole_detection): New global.
309         * src/sparse.c  (sparse_scan_file_wholesparse): New function as a
310         method for detecting sparse files without any data.
311         (sparse_scan_file_raw): Rename from sparse_scan_file; with edits.
312         (sparse_scan_file_seek): New function.
313         (sparse_scan_file): Reimplement function.
314         * src/tar.c: New option --hole-detection
315         * tests/checkseekhole.c: New file.
316         * tests/.gitignore: Mention two test binaries.
317         * tests/Makefile.am: Add new tests.
318         * tests/testsuite.at (AT_SEEKHOLE_PREREQ): New macro.
319         Include sparse06.at.
320         * tests/sparse06.at: New test case.
321         * tests/sparse02.at: Force raw hole-detection method.
322         * tests/sparsemv.at: Likewise.
323         * tests/sparsemvp.at: Likewise.
324         * doc/tar.1: Document --hole-detection option.
325         * doc/tar.texi: Document hole-detection algorithms and
326         command-line options.
327         * NEWS: Document hole-detection.
328
329 2015-12-05  Sergey Poznyakoff  <gray@gnu.org.ua>
330
331         Catch compressor execution errors.
332         * src/misc.c (write_fatal_details): Move to buffer.c
333         * src/buffer.c (write_fatal_details): Close the archive and
334         wait for
335         the compressor program to terminate in order to catch eventual
336         execution
337         errors.
338         * src/system.c (sys_child_open_for_compress): Ignore SIGPIPE so
339         tar will
340         not silently terminate when unable to write to the compressor.
341         * tests/comperr.at: New file.
342         * tests/Makefile.am: Add comperr.at
343         * tests/testsuite.at: Include comperr.at
344
345         Upgrade paxutils
346
347 2015-11-29  Sergey Poznyakoff  <gray@gnu.org.ua>
348
349         Fix extraction from concatenated incremental archives with
350         renamed directories.
351         Complements 15c02c2b.
352         * src/extract.c (delayed_set_stat): Change type of file_name.
353         (delay_set_stat): Allocate file_name member.
354         (free_delayed_set_stat): Free file_name.
355         (fixup_delayed_set_stat): New function.
356         (rename_directory): Call fixup_delayed_set_stat on success.
357         * tests/incr11.at: New testcase.
358         * tests/incr10.at: Improve description.
359         * tests/Makefile.am: Add incr11.at
360         * tests/testsuite.at: Add incr11.at
361
362 2015-11-21  Sergey Poznyakoff  <gray@gnu.org>
363
364         Fix bug in the inplementation of --one-top-level.
365         When extracting an archive that contains './' with the
366         --one-top-level option,
367         the mode and ownership of '.' would be incorrectly applied to
368         the current
369         working directory, instead of the requested top-level directory.
370         * src/list.c (enforce_one_top_level): Map '.' to the top-level
371         directory.
372         * tests/Makefile.am: Add onetop05.at
373         * tests/testsuite.at: Include onetop05.at.
374         * tests/onetop05.at: New file.
375         * tests/onetop01.at: Fix keywords.
376         * tests/onetop02.at: Likewise.
377         * tests/onetop03.at: Likewise.
378         * tests/onetop04.at: Likewise.
379
380 2015-11-11  Sergey Poznyakoff  <gray@gnu.org>
381
382         Work around unlinkat bug on FreeBSD and GNU/Hurd
383         * src/unlink.c (dunlink_insert): New function.
384         (flush_deferred_unlinks): Skip cwds and nonempty directories
385         at the first pass.  If force is requested, run a second pass
386         removing them.
387         (queue_deferred_unlink): Make sure current working directory
388         entries are sorted in descending order by the value of dir_idx.
389         This makes sure they will be removed in right order, which works
390         around unlinkat bug on FreeBSD and GNU/Hurd.
391         * tests/remfiles08b.at: Remove expected failure.
392         * tests/remfiles09b.at: Likewise.
393
394 2015-11-10  Sergey Poznyakoff  <gray@gnu.org>
395
396         Fix coredump on FreeBSD when TAR_OPTIONS is set
397         * src/tar.c (parse_default_options): Use program_name instead of
398         program_invocation_short_name.  On some systems the latter is
399         NULL when
400         the function is called, which causes coredumps.
401         (tar_set_quoting_style): Likewise.
402         * src/names.c: Likewise.
403
404 2015-11-02  Sergey Poznyakoff  <gray@gnu.org>
405
406         Use sort in T-dir tests.
407
408         Fix distclean in tests/
409         * tests/Makefile.am: Remove "download"
410
411         New options: --owner-map and --group-map.
412         * NEWS: Update.
413         * doc/tar.1: Document --owner-map and --group-map
414         * doc/tar.texi: Likewise.
415         * src/map.c: New file.
416         * src/Makefile.am: Add map.c
417         * src/common.h (owner_map_read, owner_map_translate)
418         (group_map_read, group_map_translate): New protos.
419         * src/create.c (start_header): Use owner_map_translate
420         and group_map_translate to optionally translate user/group
421         names/ids.
422         * src/tar.c: New options --owner-map and --group-map.
423         * tests/map.at: New file.
424         * tests/Makefile.am: Add map.at
425         * tests/testsuite.at: Include map.at.
426
427 2015-09-24  Kir Kolyshkin  <kir@openvz.org>  (tiny change)
428
429         doc: fix font and spelling typos
430         * doc/tar.1: Fix font and spelling typos in man page.
431
432 2015-09-24  Paul Eggert  <eggert@cs.ucla.edu>
433
434         Fix problems caught by static checking
435         Most of these can be caught by configuring with
436         --enable-gcc-warnings.
437         Problem reported by Pavel Raiskup in:
438         http://lists.gnu.org/archive/html/bug-tar/2015-09/msg00001.html
439         * src/buffer.c (format_total_stats):
440         Prefer pointer to const when it’s OK to use const.
441         (default_total_format): Now const.
442         * src/buffer.c (default_total_format):
443         * src/exclist.c (excfile_head, excfile_tail, vcs_ignore_files):
444         * src/misc.c (namebuf_add_dir, namebuf_finish):
445         * src/tar.c (verbatim_files_from_option, option_set_in_cl)
446         (optloc_eq, set_old_files_option):
447         Now static.
448         * src/common.h: Adjust to match the other changes described here.
449         * src/exclist.c (info_cleanup_exclist):
450         * src/tar.c (argp_program_version, argp_program_bug_address):
451         Remove; unused.
452         (parse_default_options): Define via prototype instead of old
453         style.
454         (parse_default_options, decode_options):
455         Fill out incomplete initializers.
456
457 2015-08-31  Sergey Poznyakoff  <gray@gnu.org>
458
459         Improve option sanity checking
460         Any two conflicting options are reported only if they both
461         occur in
462         the command line.  Otherwise, options defined in the command line
463         silently override those set in the TAR_OPTIONS environment
464         variable.
465         * src/common.h (option_source): New enum.
466         (option_locus): New struct.
467         * src/names.c (name_elt): New member: line.
468         (name_add_file): Initialize line.
469         (read_name_from_file): Keep track of input line number for
470         diagnostic
471         purposes.
472         (handle_option): Take a pointer to struct name_elt as 2nd
473         parameter;
474         pass locus info to more_options().
475         * src/tar.c (tar_args): New member: loc.
476         (option_class): New enum.
477         (optloc_save,optloc_lookup)
478         (option_set_in_cl,optloc_eq): New functions.
479         (set_use_compress_program_option): Take into account option
480         location.
481         (set_old_files_option): New function.
482         (parse_opt): Keep track of option locations.
483         (more_options): Improve error reporting.
484         (parse_default_options): New function.
485         (decode_options): Parse TAR_OPTION and command line separately.
486         Options from the latter silently override those from the former.
487         * lib/prepargs.c: Remove.
488         * lib/prepargs.h: Remove.
489         * lib/Makefile.am: Update.
490
491 2015-08-24  Sergey Poznyakoff  <gray@gnu.org>
492
493         Improve check-full
494         * tests/atlocal.in: Download external archives to
495         $abs_builddir/download.
496         (tarball_prereq): Create destination directory if necessary.
497         * tests/.gitignore: Add download
498
499         Fix check-full
500         * tests/atlocal.in (TAR_DATA_URL): Berlios is dead.  Get
501         test archives from gnu.org.ua
502
503         Include gnulib and paxutils as submodules.
504         * .gitmodules: New file.
505         * README-alpha: Update.
506         * README-hacking: Update.
507         * bootstrap: Install slightly modified version from the gnulib
508         repo.
509         * bootstrap.conf: Add paxutils-related stuff.
510         * .gitignore: Update.
511         * doc/.gitignore: Update.
512         * po/.gitignore: Update.
513         * gnu/Makefile.am
514
515         Update docs.
516         * doc/tar.1: Document --verbatim-files-from option.
517
518 2015-08-20  Sergey Poznyakoff  <gray@gnu.org.ua>
519
520         Add missing VCS files to --exclude-vcs list
521         * src/tar.c (vcs_file_table): Add .gitmodules and .gitattributes
522         * doc/tar.texi: Update.
523
524 2015-08-03  Sergey Poznyakoff  <gray@gnu.org.ua>
525
526         Options to control option handling in file lists.
527         The --verbatim-files-from option disables option handling in
528         file lists.  The --no-verbatim-files-from reverts its effect.
529         The --null option implies --verbatim-files-from.  This restores
530         the documented behavior, broken by 26538c9b.
531         * src/common.h (verbatim_files_from_option): New global.
532         * src/names.c (name_elt): New member: file.verbatim
533         (name_add_file): Take 'verbatim' state as its third parameter.
534         (read_next_name): Don't call handle_option if file.verbatim
535         is set.
536         * src/tar.c: New options --verbatim-files-from and
537         --no-verbatim-files-from.
538         * doc/tar.texi: Document --verbatim-files-from and
539         --no-verbatim-files-from options.
540         * NEWS: Update.
541         * configure.ac: Version 1.28.90
542         * tests/T-null2.at: New testcase.
543         * tests/Makefile.am: Update.
544         * tests/testsuite.at: Update.
545
546 2015-07-25  Anders Jonsson  <anders.jonsson@norsjovallen.se>  (tiny
547 change)
548
549         Fix typos (preceeded etc.)
550
551 2015-07-13  Paul Eggert  <eggert@cs.ucla.edu>
552
553         tar: fix symlink race and symlink transform bug
554         Problem reported by Tobias Stoeckmann in:
555         http://lists.gnu.org/archive/html/bug-tar/2015-07/msg00004.html
556         * gnulib.modules: Add areadlinkat-with-size.
557         * src/create.c: Include areadlink.h.
558         (dump_file0): Use areadlinkat_with_size, rather than trying to do
559         it by hand, incorrectly.  This also avoids assumption that
560         the symlink contents fit on the stack.  Also, use the transformed
561         link name, not the original link name, when deciding whether the
562         name is long enough to require writing a long link.
563
564         tar: port -d to longer symlinks
565         * src/compare.c (diff_symlink):
566         Don't use alloca on symlink length; it might be too big for
567         the stack.
568         Don't assume that readlinkat's return value fits in 'int'.
569         Prefer memcmp to strncmp where either will do.
570
571         tar: port to recent gnulib
572         * gnulib.modules: Remove 'acl' and add 'file-has-acl'.
573
574         tar: pacify GCC 5.1 -Wformat-signedness
575         * lib/wordsplit.c (struct wordsplit_node.flags):
576         Now unsigned, so that 'printf ("%x", p->flags)' doesn't provoke
577         GCC.
578         * src/incremen.c (read_num, dumpdir_ok):
579         Don't printf an int with %x or %o.
580
581 2015-04-16  Sergey Poznyakoff  <gray@gnu.org.ua>
582
583         Fix extraction from concatenated incremental archives.
584         * src/common.h (remove_delayed_set_stat): New proto.
585         * src/extract.c (free_delayed_set_stat)
586         (remove_delayed_set_stat): New function.
587         (apply_nonancestor_delayed_set_stat): Use free_delayed_set_stat.
588         * src/misc.c (safer_rmdir): Remove delayed_set_stat entry
589         corresponding to the removed directory.
590         * tests/incr10.at: New test case.
591         * tests/Makefile.am: Add new test.
592         * tests/testsuite.at: Likewise.
593
594 2015-04-10  Sergey Poznyakoff  <gray@gnu.org.ua>
595
596         Fix make installcheck
597         Make installcheck would fail unless make check had been run
598         before it.
599         Reported by Erik Brangs <erik.brangs@gmx.de>
600         * tests/Makefile.am (installcheck-local): Depend on
601         $(check_PROGRAMS)
602
603 2015-03-18  Paul Eggert  <eggert@cs.ucla.edu>
604
605         tar: don't assume GZIP
606         * Makefile.am (dist-hook): Port to gzip implementations that
607         warn about nontrivial settings in the GZIP environment var.
608
609 2015-03-17  Paul Eggert  <eggert@cs.ucla.edu>
610
611         tar: don't suggest GZIP
612         * doc/tar.texi (gzip): Don't suggest using the GZIP environment
613         variable, as it will be deprecated in the next gzip release.
614
615 2015-02-19  Sergey Poznyakoff  <gray@gnu.org.ua>
616
617         Improve compression format recognition
618         Some comressed archives can pass the checksum test, which
619         makes tar
620         treat them as uncompressed archives.
621         * src/buffer.c (check_compressed_archive): Test the checksum only
622         if the block we read looks like a valid tar header (i.e. has
623         a magic string).
624
625 2015-01-06  Paul Eggert  <eggert@cs.ucla.edu>
626
627         tar: port xattr-at.c to Solaris 10
628         * lib/xattr-at.c (setxattrat, lsetxattrat, getxattrat,
629         lgetxattrat)
630         (listxattrat, llistxattrat): Compile only if HAVE_XATTRS, so that
631         the code doesn't call functions that are not declared.
632
633         tar: port wordsplit attribute to Sun C
634         Reported by Ted Carr in:
635         http://lists.gnu.org/archive/html/bug-tar/2015-01/msg00002.html
636         * lib/wordsplit.h (__WORDSPLIT_ATTRIBUTE_FORMAT):
637         New macro, taken from Gnulib.
638         (struct wordsplit): Use it.
639         * lib/wordsplit.c (_wsplt_error): Use it.
640
641 2014-12-17  Sergey Poznyakoff  <gray@gnu.org>
642
643         Silent a cc warning
644         * src/xheader.c (xheader_string_end): Make sure pointer
645         arithmetics applies on char*.
646
647 2014-12-12  Paul Eggert  <eggert@cs.ucla.edu>
648
649         tar: port ISFOUND, WASFOUND to C89
650         Problem reported by Romano Maspero in:
651         http://lists.gnu.org/archive/html/bug-tar/2014-12/msg00010.html
652         * src/common.h (ISFOUND, WASFOUND): Port to C89.
653
654 2014-12-10  Sergey Poznyakoff  <gray@gnu.org.ua>
655
656         Fix tar -c -l file file
657         When the same file is added several times to the archive, count
658         correctly the number of hard links.  See also 37ddfb0b.
659         * src/create.c (dump_hard_link): Don't decrease nlink if it is 0.
660         * tests/link04.at: Test -cl options.
661
662 2014-11-07  Sergey Poznyakoff  <gray@gnu.org>
663
664         Honor the pax-option overrides when creating archive.
665         Changes proposed by Denis Excoffier.
666         * NEWS: Fix typos.
667         * doc/tar.texi: Fix typos.  Improve recipe for creation of binary
668         equivalent archives.
669         * src/create.c (write_extended): Use the value of the
670         --mtime option (if specified) as the default for exthdr.mtime.
671         * src/xheader.c (xheader_store): Create the header if at least
672         one override is supplied in --pax-option.
673
674         Add testcase for the previous commit.
675         * tests/sparse05.at: New file.
676         * tests/Makefile.am: Add sparse05.at
677         * tests/testsuite.at: Include sparse05.at
678
679 2014-11-07  Pavel Raiskup  <praiskup@redhat.com>
680
681         Fix bug in sparse file listing
682         List posix archives containing sparse files >8GB correctly and
683         do not fail.
684         This fixes also bug in format of listing for sparse files >8GB -
685         now the
686         real size is printed instead of the effective one (this is
687         not strictly
688         posix format related).
689         * src/list.c: Remove redundant assignment.
690         * src/tar.h: Add new 'real_size' and 'real_size_set' fields in
691           tar_stat_info struct.
692         * src/xheader.c: Correctly handle (especially sparse) file sizes
693         directly in
694           xheader_decode().
695
696 2014-10-15  Sergey Poznyakoff  <gray@gnu.org.ua>
697
698         Fix a typo
699
700 2014-10-01  Sergey Poznyakoff  <gray@gnu.org>
701
702         Fix README
703         Remove the reference to PORTS
704
705 2014-09-25  Sergey Poznyakoff  <gray@gnu.org>
706
707         Bugfixes.
708         * doc/tar.1: Fix typo in font spec.
709         * src/tar.c (sort_mode_arg, sort_mode_flag): Protect "inode"
710         (SAVEDIR_SORT_INODE) with D_INO_IN_DIRENT
711
712 2014-09-18  Sergey Poznyakoff  <gray@gnu.org.ua>
713
714         Bugfix: entries read from the -T file did not get proper
715         matching_flag.
716         * src/common.h (name_add_file): Change signature.
717         * src/names.c (name_elt_alloc_matflags): New function.
718         (name_add_name): Use name_elt_alloc_matflags.
719         (name_add_file): Take matching flags as third argument.
720         (read_next_name): Remove trailing slashes.
721         * src/tar.c (parse_opt): Pass matching_flags to name_add_file.
722         * tests/T-dir00.at: New file.
723         * tests/T-dir01.at: New file.
724         * tests/Makefile.am: Add new testcases.
725         * tests/testsuite.at: Likewise.
726
727 2014-08-16  Sergey Poznyakoff  <gray@gnu.org>
728
729         Improve documentation.
730         * doc/tar.1: Document --skip-old-files and --warning=existing-file
731         * doc/tar.texi: Document --warning=existing-file
732
733 2014-07-27  Sergey Poznyakoff  <gray@gnu.org>
734
735         Version 1.28
736
737 2014-07-27  Nathan Stratton Treadway  <nathanst@ontko.com>
738
739         Minor change in docstrings. nor ch#
740
741         Restructure the remfiles testsuite.
742
743 2014-07-22  Sergey Poznyakoff  <gray@gnu.org>
744
745         Don't build ttyemu and run tty I/O test if grantpt is not
746         available.
747         * configure.ac (TAR_COND_GRANTPT): Define conditional depending
748         on whether grantpt is available.
749         * gnulib.modules: Remove grantpt. It relies upon a helper binary
750         pt_chown which it installs and which is useless in the testsuite.
751         * tests/Makefile.am [TAR_COND_GRANTPT]: Build ttyemu
752         * tests/iotty.at: Skip test if ttyemu is not build.
753         * tests/ttyemu.c (noecho): Fix error message
754         (main): Use TIOCSCTTY if it is defined.
755
756 2014-07-22  Benno Schulenberg  <bensberg@justemail.net>
757
758         Fix a typo and some wordings in the documentation.
759         * doc/tar.texi: Fix some missing articles, and make it clearer
760         that "any" does not mean "anything" but "either of the two".
761
762 2014-07-22  Nathan Stratton Treadway  <nathanst@ontko.com>
763
764         Fix the testsuite
765         * tests/incr07.at: Don't assume case-sensitive filesystem.
766
767 2014-07-11  Paul Eggert  <eggert@cs.ucla.edu>
768
769         tar: minor fixups related to recent checkpoint.c change
770         * src/checkpoint.c (getwidth, format_checkpoint_string):
771         Use long and strtol, not int, to avoid overflow issues.
772         (getwidth): Don't assume termios.h defines TIOCGWINSZ,
773         as it doesn't on some older hosts.
774
775 2014-07-11  Sergey Poznyakoff  <gray@gnu.org>
776
777         Bugfixes
778         * gnulib.modules: Add faccessat
779         * src/checkpoint.c: Include termios.h
780
781 2014-06-29  Nathan Stratton Treadway  <nathanst@ontko.com>
782
783         tar: document xgetcwd test case better
784         * src/misc.c (normalize_filename): Add commentary for clarity.
785         * tests/extrac09.at: Retitle test case and add comments for
786         clarity.
787
788 2014-06-24  Sergey Poznyakoff  <gray@gnu.org.ua>
789
790         Fix typos in ChangeLog
791         * ChangeLog.CVS: Fix typos.
792         * ChangeLog.amend: New file.
793         * Makefile.am: Define changelog_amend_file.
794
795 2014-04-30  Paul Eggert  <eggert@cs.ucla.edu>
796
797         tar: do not dereference NULL pointer with '--remove-files .'
798         Problem reported by Thorsten Hirsch in:
799         http://lists.gnu.org/archive/html/bug-tar/2014-04/msg00011.html
800         * src/unlink.c (flush_deferred_unlinks):
801         Do not attempt to find the parent of "." when "." is
802         at the top level.
803         * tests/remfiles10.at: New file.
804         * tests/Makefile.am (TESTSUITE_AT):
805         * tests/testsuite.at: Add it.
806
807 2014-03-27  Sergey Poznyakoff  <gray@gnu.org>
808
809         Refuse to write archive contents to a tty.
810         * NEWS: Update.
811         * src/buffer.c (_open_archive): Refuse to write to a tty.
812         * tests/iotty.at: Test output to a tty.
813
814 2014-03-26  Vitezslav Cizek  <vcizek@suse.cz>
815
816         fix an eternal loop in handle_option
817         * src/names.c (handle_option): increment loop counter
818
819 2014-03-20  Sergey Poznyakoff  <gray@gnu.org.ua>
820
821         Fail if archive comes from a terminal.
822         Based on patch from Pavel Raiskup <praiskup@redhat.com>.
823         * gnulib.modules: Add new modules.
824         * src/buffer.c (_open_archive): Refuse to read archive from a tty.
825         * tests/Makefile.am (TESTSUITE_AT): Add iotty.at
826         (check_PROGRAMS): New program ttyemu
827         * tests/testsuite.at: Include iotty.at
828         * tests/iotty.at: New file.
829         * tests/ttyemu.c: New file.
830
831 2014-03-13  Paul Eggert  <eggert@cs.ucla.edu>
832
833         tar: port to Solaris 9
834         Problem reported by Jesse C in:
835         http://lists.gnu.org/archive/html/bug-tar/2014-03/msg00034.html
836         * gnulib.modules: Add strtoimax and strtoumax, since tar invokes
837         these functions directly and they don't exist on Solaris 9.
838
839 2014-02-25  Sergey Poznyakoff  <gray@gnu.org.ua>
840
841         Test the --[no-]recursive options (see commit 2bd9c153).
842         * tests/recurs02.at: New test case.
843         * tests/Makefile.am: Add new file.
844         * tests/testsuite.at: Add new file.
845
846 2014-02-22  Sergey Poznyakoff  <gray@gnu.org.ua>
847
848         Support exclusion patterns from various VCS ignore lists.
849         * src/Makefile.am (tar_SOURCES): Add exclist.c
850         * src/common.h (EXCL_DEFAULT, EXCL_RECURSIVE)
851         (EXCL_NON_RECURSIVE): New flags.
852         (excfile_add, info_attach_exclist)
853         (info_cleanup_exclist,info_free_exclist)
854         (exclude_vcs_ignores): New prototypes.
855         * src/create.c (dump_dir0): Call info_attach_exclist.
856         * src/exclist.c: New file.
857         * src/incremen.c (scan_directory): Call info_attach_exclist.
858         * src/names.c (excluded_name): Moved to exclist.c. Change
859         signature.
860         All uses updated.
861         * src/tar.c: New options: --exclude-ignore,
862         --exclude-ignore-recursive
863         and --exclude-vcs-ignores.
864         (tar_stat_destroy): Free exclist.
865         * src/tar.h (tar_stat_info): New member exclude_list.
866         * NEWS: Document new exclusion options.
867         * doc/tar.texi: Likewise.
868         * doc/tar.1: Likewise.
869
870 2014-02-14  Sergey Poznyakoff  <gray@gnu.org.ua>
871
872         Fix in testsuite
873         * acls03.at: Fix improper invocation of setfacl.
874
875 2014-02-14  Pavel Raiskup  <praiskup@redhat.com>
876
877         testsuite: add test for buggy default ACLs
878         * tests/Makefile.am: Mention acls03.at.
879         * tests/testsuite.at: Likewise.
880         * tests/acls03.at: New testcase.
881
882         acls: bugfix for default ACLs extraction
883         When --acls option is on (regardless of tarball contents or
884         tarball format), we should explicitly set OR delete default ACLs
885         for extracted directories.  Prior to this update, we always
886         created arbitrary default ACLs based standard file permissions.
887         * configure.ac (with_posix_acls): Check also for acl_free and
888         acl_delete_def_file to mark IEEE 1003.1e ACLs as supported.
889         * src/xattrs.c (acl_delete_def_file_at): New function.
890         (xattrs__acls_set): Do not treat acls_option at all;  Delete
891         default ACLs if appropriate.
892         References:
893         http://www.mail-archive.com/bug-tar@gnu.org/msg04355.html
894         Thanks: Juan J. Martínez and Mark Steinborn
895
896         tar: imply --xattrs when --xattrs-{inc,exc}lude used
897         Options --xattrs-include=MASK and --xattrs-exclude=MASK now turn
898         on the --xattrs option.
899         Fix also bug in printing in xattrs.c - don't print when option is
900         negative.
901         * src/tar.c (set_xattr_option): New static function.
902         (parse_opt): Call new function when --xatrrs, --xattrs-include or
903         --xattrs-exclude option is used.
904         * src/xattrs.c (xattrs_print, xattrs_print_char): Expect positive
905         values in options.
906
907 2014-02-14  Sergey Poznyakoff  <gray@gnu.org.ua>
908
909         THANKS: Add Anthony G. Basile.
910
911         Use correct headers/libraries when providing xattr support
912         See https://savannah.gnu.org/patch/index.php?8252. Patch provided
913         by Anthony G. Basile.
914         * acinclude.m4 (TAR_HEADERS_ATTR_XATTR_H): Look for <sys/xattr.h>
915         first and then for <attr/xattr.h>.  Link against libattr.so if
916         needed.
917         * lib/xattr-at.h: Include sys/xattr.h or attr/xattr.h, depending
918         on which one is detected.
919         * src/Makefile.am [TAR_LIB_ATTR] (tar_LDADD): Link against -lattr.
920
921         Minor change
922         * src/tar.c (decode_options): Silently ignore --one-top-level
923         if used with a non-reading command.
924
925 2014-02-14  Sergey Poznyakoff  <gray@gnu.org>
926
927         New option --sort=ORDER
928         This option makes tar sort the entries of directories that will be
929         added to an archive according to ORDER (none, name, or inode).
930         Based on proposition by Dick Streefland
931         (https://savannah.gnu.org/patch/?7892).
932         * src/common.h (savedir_sort_order): New global.
933         * src/create.c: Pass savedir_sort_order to streamsavedir.
934         * src/misc.c: Likewise.
935         * src/tar.c: New option --sort.
936         * NEWS: Update.
937         * doc/tar.texi: Document the --sort option.
938         * doc/tar.1: Likewise.
939
940 2014-02-13  Sergey Poznyakoff  <gray@gnu.org>
941
942         Fix the testsuite
943         * tests/opcomp01.at: Update expected error messages.
944         * tests/opcomp03.at: Likewise.
945
946 2014-02-13  Sergey Poznyakoff  <gray@gnu.org.ua>
947
948         Fix --one-top-level used together with --list.
949         * src/extract.c: Move one_top_level stuff to tar.c
950         (decode_options).
951         * src/tar.c (option_conflict_error): New function.
952         (decode_options): Use option_conflict_error to complain about
953         conflicting options in a uniform manner.
954         Process one_top_level options here.
955         (request_stdin): Fix error message.
956         * tests/onetop04.at: New testcase: check --one-top-level with
957         --list.
958         * tests/Makefile.am: Add new testcase.
959         * tests/testsuite.at: Add new testcase.
960
961         Fix NEWS
962         * NEWS: Remove duplicate description of the --one-top-level
963         option.
964
965 2014-02-12  Sergey Poznyakoff  <gray@gnu.org.ua>
966
967         configure.ac: look for host-prefixed ar
968         See https://savannah.gnu.org/patch/?8183
969
970 2014-02-10  Sergey Poznyakoff  <gray@gnu.org>
971
972         Bugfix
973         * src/suffix.c (find_compression_suffix): Fix eventual coredump.
974
975 2014-02-10  Sergey Poznyakoff  <gray@gnu.org.ua>
976
977         Fix docs.
978
979         Update docs.
980         * NEWS: Document --one-top-level
981         * THANKS: Mention Connor Behan
982
983 2014-01-30  Sergey Poznyakoff  <gray@gnu.org.ua>
984
985         Update copyright years.
986
987 2014-01-28  Sergey Poznyakoff  <gray@gnu.org.ua>
988
989         Improve one-top-level functionality
990         Make sure the changes become visible with
991         --show-transformed-names.
992         * src/common.h (strip_compression_suffix): New function.
993         (one_top_level): Rename to one_top_level_dir. All uses changed.
994         * src/extract.c (extr_init): Use strip_compression_suffix.
995         Bail out if unable to determine top-level directory.
996         (maybe_prepend_name): Remove. All uses removed.
997         * src/tar.c (options): --one-top-level takes optional argument.
998         (parse_opt): Handle it.
999         * src/list.c (enforce_one_top_level): New function.
1000         (transform_stat_info): Call enforce_one_top_level if required.
1001         * src/suffix.c (compression_suffixes): List "tar" (no
1002         compression);
1003         terminate with NULL entry.
1004         (find_compression_suffix): New static.
1005         (strip_compression_suffix): New function.
1006         * doc/tar.1: Update.
1007         * doc/tar.texi: Update.
1008         * tests/onetop01.at: New testcase.
1009         * tests/onetop02.at: New testcase.
1010         * tests/onetop03.at: New testcase.
1011         * tests/Makefile.am: Add new testcases.
1012         * tests/testsuite.at: Likewise.
1013
1014 2014-01-27  Connor Behan  <connor.behan@gmail.com>
1015
1016         Detect tarbombs while extracting
1017         * src/common.h (one_top_level_option): New global.
1018         (one_top_level): New global.
1019         * src/extract.c (extr_init): If one_top_level_option is set,
1020         determine
1021         the name one_top_level that might have to be prepended.
1022         (extract_archive): If one_top_level_option is set, prepend
1023         one_top_level
1024         to all names that don't already start with it.
1025         * src/tar.c (ONE_TOP_LEVEL_OPTION): New content.
1026         (options): New option --one-top-level.
1027         (parse_opt): Handle this option.
1028         (decode_options): Make it conflict with --absolute-names.
1029
1030 2014-01-27  Sergey Poznyakoff  <gray@gnu.org.ua>
1031
1032         Don't install rmt.8 if rmt is not built.
1033         * doc/Makefile.am [PU_RMT_COND]: Define RMT_8
1034         (dist_man_MANS): use RMT_8 instead of the hardcoded rmt.8
1035
1036         Provide tar(1) and rmt(8) manpages.
1037         * NEWS: Update.
1038         * doc/Makefile.am: Add manpages.
1039         * doc/tar.1: New file.
1040         * src/tar.c (tar_help_filter): Handle LZOP_OPTION.
1041
1042 2014-01-23  Sergey Poznyakoff  <gray@gnu.org.ua>
1043
1044         Make sure transformed file names retain trailing slash in listing.
1045         * src/list.c (simple_print_header): Print trailing slash
1046         if using the transformed name.
1047         Use had_trailing_slash instead of analyzing last byte if temp_name
1048
1049 2014-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>
1050
1051         checkpoint actions: further improvements.
1052         * NEWS: Update.
1053         * doc/tar.texi: Update.
1054         * src/buffer.c (print_stats): Avoid use of additional string
1055         buffer.
1056         Allow for text to be NULL.
1057         Call gettext if it is not.
1058         (format_total_stats): Don't use gettext when calling print_stats.
1059         * src/checkpoint.c (def_format): Change default format.
1060         (format_checkpoint_string): Implement optional arguments for
1061         T conversion.
1062         (finish_checkpoint_actions): Rename to checkpoint_flush_actions,
1063         make extern.  All uses changed.
1064         * src/common.h (checkpoint_flush_actions): New proto.
1065         * src/tar.c (main): Set error_hook
1066
1067 2014-01-22  Sergey Poznyakoff  <gray@gnu.org>
1068
1069         Improve checkpoint interface.
1070         * src/buffer.c (format_total_stats): The format arg is const
1071         All uses updated.
1072         (default_total_format): const
1073         * src/checkpoint.c (tty, tty_cleanup): New static.
1074         (format_checkpoint_string): New "canned" format %c
1075         (checkpoint_finish): New function.
1076         * src/common.h (checkpoint_finish): New proto.
1077         * src/tar.c (main): Call checkpoint_finish.`
1078
1079 2014-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1080
1081         Implement statistics display in checkpoint actions.
1082         * NEWS: Update.
1083         * configure.ac: Version 1.27.90
1084         * gnulib.modules: Add fprintftime.
1085         * doc/tar.texi: Document the "totals" action and new format
1086         specifiers
1087         for echo and ttyout checkpoint actions.
1088         * src/buffer.c (compute_duration): Return computed value.
1089         (print_stats): Don't print trailing newline.  Return number of
1090         characters output.
1091         (format_total_stats): New function.
1092         (print_total_stats): Rewrite via format_total_stats.
1093         * src/checkpoint.c (checkpoint_opcode) <cop_totals>: New opcode.
1094         (checkpoint_compile_action): Handle cop_totals.
1095         (expand_checkpoint_string): Remove.
1096         (format_checkpoint_string): New function to be used instead of
1097         expand_checkpoint_string.  All callers updated.
1098         * src/common.h (TF_READ,TF_WRITE)
1099         (TF_DELETED): New constants.
1100         (format_total_stats,print_total_stats): New protos.
1101
1102 2014-01-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1103
1104         Remove shar archives from distribution.
1105         These are going to phase out in automake 2.0
1106
1107 2014-01-10  Sergey Poznyakoff  <gray@gnu.org>
1108
1109         Fix the use of --no-recursion and --recursion options.
1110         Each option remains in effect until cancelled by the next
1111         occurrence
1112         of its counterpart, as stated in the documentation.
1113         * src/names.c (name_next_elt): Restore recursion_option from the
1114         value of matching_flags.
1115
1116 2014-01-09  Sergey Poznyakoff  <gray@gnu.org.ua>
1117
1118         Minor bugfixes
1119         * src/compare.c (diff_dumpdir): Close descriptor if fstat failed.
1120         (diff_multivol): Make sure the descriptor is closed and eventual
1121         errors reported if lseek fails.
1122         Both reported by Jiri Kukacka.
1123
1124 2014-01-07  Paul Eggert  <eggert@cs.ucla.edu>
1125
1126         tar: work around IBM XL C bug
1127         * src/incremen.c (show_snapshot_field_ranges)
1128         (write_directory_file_entry): Use simpler array size expression,
1129         one that evaluates to the same value.  This works around
1130         a compiler
1131         bug with IBM XL C.  Problem reported by Yannick Bergeron in
1132         <http://lists.gnu.org/archive/html/bug-tar/2014-01/msg00009.html>.
1133
1134 2014-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1135
1136         tar: update ancient configure cruft
1137         * configure.ac: Use AC_PROG_CC_STDC, not just AC_PROG_CC.
1138         Remove obsolete macros AC_ISC_POSIX, AC_HEADER_SYS_WAIT,
1139         AC_HEADER_DIRENT, AC_HEADER_STAT, AC_HEADER_STDC, AC_TYPE_SIGNAL,
1140         AC_TYPE_SIZE_T.
1141         * lib/prepargs.c (IN_CTYPE_DOMAIN): Remove.  All uses removed.
1142         * src/list.c (from_header): Use isspace, not ISSPACE.
1143         * src/system.c (pipe_handler, sys_exec_info_script):
1144         * src/tar.c (sigstat):
1145         Use void, not RETSIGTYPE.
1146
1147 2013-11-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1148
1149         Version 1.27.1
1150
1151         Fix star compatibility (sparse headers)
1152         * src/sparse.c (star_get_sparse_info): Update file->dumped_size
1153
1154         Fix GNU long link header.
1155         * src/create.c (write_gnu_long_link): Set timestamp to
1156         0 for backward compatibility.  Bug reported by David Barri.
1157         * THANKS: Update.
1158
1159         Fix unquoting of input file names.
1160         * src/names.c (read_next_name): Unquote file names coming from the
1161         -T argument.  Bug reported by Nicolas Dudebout.
1162         * THANKS: Update.
1163
1164 2013-10-24  Paul Eggert  <eggert@cs.ucla.edu>
1165
1166         build: fix bug where 'configure --with-posix-acls' disables ACLs
1167         Reported by Lars Wendler in
1168         <http://lists.gnu.org/archive/html/bug-tar/2013-10/msg00022.html>.
1169         * configure.ac (with_posix_acls): Fix typo.
1170
1171 2013-10-23  Paul Eggert  <eggert@cs.ucla.edu>
1172
1173         Fix core dump on Solaris 10 when "." isn't readable.
1174         Reported by Peter Kruse in
1175         <http://lists.gnu.org/archive/html/bug-tar/2013-10/msg00017.html>.
1176         This doesn't fix all the Solaris 10 test failures, just the
1177         core dump.
1178         * src/common.h, src/misc.c (tar_getcdpath): Now static.
1179         * src/misc.c (normalize_filename): Report a fatal error
1180         if cdpath is null, since we don't know the absolute name
1181         of the working directory in that case.  FIXME: there should
1182         be no need to know absolute file names.
1183         (chdir_arg): Simplify wd allocation.
1184         Don't assume that xgetcwd returns non-null.
1185
1186 2013-10-06  Sergey Poznyakoff  <gray@gnu.org.ua>
1187
1188         Version 1.27
1189         * NEWS: Update.
1190         * configure.ac: Update.
1191
1192         Minor fixes.
1193         * src/names.c: Include argp.h
1194         * tests/testsuite.at (AT_XATTRS_UTILS_PREREQ)
1195         (AT_SELINUX_UTILS_PREREQ,AT_ACLS_UTILS_PREREQ)
1196         (AT_CAPABILITIES_UTILS_PREREQ)
1197         (AT_XATTRS_PREREQ,AT_SELINUX_PREREQ)
1198         (AT_ACLS_PREREQ): Use POSIX-compatible syntax for
1199         mktemp.
1200         * tests/incr08.at: Fix find usage.
1201
1202 2013-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1203
1204         Xfail the remfiles09b test.
1205         * tests/remfiles09b.at: Turn into expected failure.
1206
1207 2013-10-05  Nathan Stratton Treadway  <nathanst@ontko.com>
1208
1209         Tiny change
1210         * scripts/tar-snapshot-edit: Mention --show-snapshot-field-ranges
1211         option
1212
1213 2013-10-05  Pavel Raiskup  <praiskup@redhat.com>
1214
1215         Tiny change
1216         * configure.ac (RSH): Define as AC_ARG_VAR.
1217
1218 2013-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1219
1220         Fix namespace contamination in testsuite.
1221         * tests/append01.at: Use m4_pushdef/m4_popdef to define local
1222         macros.
1223         * tests/delete03.at: Likewise.
1224         * tests/exclude06.at: Likewise.
1225         * tests/incr04.at: Likewise.
1226         * tests/link03.at: Likewise.
1227         * tests/long01.at: Likewise.
1228         * tests/longv7.at: Likewise.
1229         * tests/lustar01.at: Likewise.
1230         * tests/lustar02.at: Likewise.
1231         * tests/lustar03.at: Likewise.
1232         * tests/multiv05.at: Likewise.
1233         * tests/sparse04.at: Likewise.
1234
1235 2013-10-05  Nathan Stratton Treadway  <nathanst@ontko.com>
1236
1237         Provide comprehensive testcases for various file removal modes.
1238         * tests/Makefile.am: Add new testcases.
1239         * tests/testsuite.at: Likewise.
1240         * tests/incr09.at: Add description.
1241         * tests/remfiles04a.at: New file.
1242         * tests/remfiles05.at: Rename to ...
1243         * tests/remfiles04b.at: ... this.
1244         * tests/remfiles04.at: Rename to ...
1245         * tests/remfiles04c.at: ... this.
1246         * tests/remfiles05a.at: New file.
1247         * tests/remfiles05b.at: New file.
1248         * tests/remfiles06.at: Rename to ...
1249         * tests/remfiles05c.at: ... this.
1250         * tests/remfiles06a.at: New file.
1251         * tests/remfiles06b.at: New file.
1252         * tests/remfiles06c.at: New file.
1253         * tests/remfiles07a.at: New file.
1254         * tests/remfiles07b.at: New file.
1255         * tests/remfiles07c.at: New file.
1256         * tests/remfiles08a.at: New file.
1257         * tests/remfiles08b.at: New file.
1258         * tests/remfiles08c.at: New file.
1259         * tests/remfiles08.at: Rename to ...
1260         * tests/remfiles09a.at: ... this.
1261         * tests/remfiles09b.at: New file.
1262         * tests/remfiles07.at: Rename to ...
1263         * tests/remfiles09c.at: ... this.
1264
1265 2013-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>
1266
1267         Tiny changes.
1268         * src/misc.c: Fix comments, rename wd.cwd to wd.abspath (Nathan
1269         Stratton
1270         Treadway);
1271         * src/tar.c (options): Reword description of the --starting-file
1272         and
1273         --preserve-order options.
1274         (decode_options): Both --starting-file and --preserve-order
1275         have meaning
1276         only when used together with an archive reading command. (Pavel
1277         Raiskup).
1278
1279 2013-10-01  Sergey Poznyakoff  <gray@gnu.org.ua>
1280
1281         Revamp tar_getcwd/normalize_filename stuff.
1282         The changes are based on the discussion with Nathan.
1283         * src/common.h (normalize_filename): Take two arguments. All
1284         callers updated.
1285         (tar_getcwd): Replaced with ..
1286         (tar_getcdpath): New proto.
1287         * src/misc.c (normalize_filename): Take two arguments.
1288         (chdir_arg): Populate cwd along with creating the
1289         structure.
1290         (tar_getcwd): Removed.
1291         (tar_getcdpath): New function.
1292         * tests/incr09.at: New test case.
1293         * tests/Makefile.am: Add new tests.
1294         * tests/testsuite.at: Likewise.
1295
1296 2013-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>
1297
1298         Bugfix
1299         * tests/remfiles08.at: Restore missing find
1300
1301 2013-09-26  Sergey Poznyakoff  <gray@gnu.org.ua>
1302
1303         Use relative addressing in deferred unlinks.
1304         * src/common.h (tar_dirname): New function.
1305         * src/misc.c (normalize_filename_x): Make extern.
1306         (tar_dirname): New function.
1307         (tar_getcwd): Take into account absolute pathnames.
1308         * src/unlink.c (deferred_unlink) <dir_idx>: New member; keeps the
1309         value of chdir_current at the moment of structure allocation.
1310         (flush_deferred_unlinks): Use chdir_do and relative addressing.
1311         (queue_deferred_unlink): Initialize dir_idx.
1312         * tests/Makefile.am: Add new tests.
1313         * tests/testsuite.at: Add new tests.
1314         * tests/remfiles06.at: Fix description.
1315         * tests/remfiles07.at: Fix description.
1316         * tests/remfiles08.at: New test case.
1317
1318 2013-09-25  Nathan Stratton Treadway  <nathanst@ontko.com>
1319
1320         Improve tar-snapshot-edit
1321         Support architecture-specific field ranges for the "-c" function.
1322         Better handle negative or larger-than-32-bit field values even
1323         when running in 32-bit Perl (for the default "print a summary"
1324         function)
1325
1326 2013-09-25  Sergey Poznyakoff  <gray@gnu.org.ua>
1327
1328         Improve tar_getcwd
1329         * src/common.h (tar_getcwd): Return pointer is const.
1330         * src/misc.c (wd) <cwd>: New member.
1331         (chdir_arg): Initialize cwd.
1332         (tar_getcwd): Use cwd member to cache the result.  Take into
1333         account absolute pathnames,
1334         (normalize_filename): Don't free the value
1335         returned from tar_getcwd.
1336         * src/names.c (name_next_elt): Remove leftover call chdir().
1337         * tests/Makefile.am: Add new tests.
1338         * tests/testsuite.at: Likewise.
1339         * tests/incr08.at: New testcase.
1340         * tests/remfiles04.at: New testcase.
1341         * tests/remfiles05.at: New testcase.
1342         * tests/remfiles06.at: New testcase.
1343         * tests/remfiles07.at: New testcase.
1344
1345 2013-09-24  Sergey Poznyakoff  <gray@gnu.org.ua>
1346
1347         Fix normalize_filename.
1348         The function did not take into account eventual -C options, which
1349         in particular led to various problems when using -C and
1350         --remove-files
1351         together.
1352         * src/common.h (namebuf_add_dir,namebuf_finish)
1353         (tar_getcwd): New prototypes.
1354         * src/misc.c (namebuf_add_dir,namebuf_finish)
1355         (tar_getcwd): New functions.
1356         (normalize_filename): Use tar_getcwd.
1357
1358 2013-09-23  Sergey Poznyakoff  <gray@gnu.org.ua>
1359
1360         Changes for compatibility with Slackware installation scripts.
1361         * src/buffer.c (short_read): the "Record size" message
1362         is controlled by the WARN_RECORD_SIZE warning_option bit.
1363         * src/common.h (keep_directory_symlink_option): New global.
1364         (WARN_RECORD_SIZE): New constant.
1365         (WARN_VERBOSE_WARNINGS): Add WARN_RECORD_SIZE.
1366         * src/extract.c (extract_dir): If keep_directory_symlink_option is
1367         set, follow symlinks to directories.
1368         * src/suffix.c (compression_suffixes): Add support for txz
1369         suffix.
1370         * src/tar.c (KEEP_DIRECTORY_SYMLINK_OPTION): New constant.
1371         (options): New option --keep-directory-symlink.
1372         (parse_opt): Handle this option.
1373         * src/warning.c: Implement "record-size" warning control.
1374         * NEWS: Update.
1375         * doc/tar.texi: Document new features.
1376
1377 2013-09-21  Sergey Poznyakoff  <gray@gnu.org.ua>
1378
1379         Fix error message (complements 0ea6e686)
1380         * src/tar.c (set_subcommand_option): Mention --delete in the
1381         error message.
1382
1383 2013-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>
1384
1385         Improve the incr07 test
1386
1387 2013-09-15  Nathan Stratton Treadway  <nathanst@ontko.com>
1388
1389         Implement the --show-snapshot-field-ranges option
1390         * src/common.h (show_snapshot_field_ranges): New prototype.
1391         * src/incremen.c (show_snapshot_field_ranges): New function.
1392         * src/tar.c: New option --show-snapshot-field-ranges.
1393         * doc/snapshot.texi: Document the --show-snapshot-field-ranges
1394         option.
1395         * doc/tar.texi: Likewise.
1396
1397 2013-09-15  Sergey Poznyakoff  <gray@gnu.org.ua>
1398
1399         Take into account chdir_fd when extracting from incremental dumps.
1400         * src/common.h (tar_savedir): New prototype.
1401         * src/misc.c (tar_savedir): New function.
1402         (remove_any_file): Use tar_savedir.
1403         * src/incremen.c (try_purge_directory): Use tar_savedir.
1404         * src/update.c (update_archive): Use tar_savedir.
1405         * tests/incr07.at: New testcase.
1406         * tests/Makefile.am (TESTSUITE_AT): Add new test.
1407         * tests/testsuite.at: Likewise.
1408         * THANKS: Updated.
1409
1410         Minor fix
1411         * src/tar.c (main): Mention --delete in the error message.
1412         * THANKS: Update
1413
1414 2013-09-13  Paul Eggert  <eggert@cs.ucla.edu>
1415
1416         * src/names.c (file_list_name): Properly prototype.
1417
1418         tar: don't warn about zero timestamps
1419         * src/extract.c (check_time): Suppress warning when t.tv_sec == 0.
1420         Problem reported by Denis Excoffier.
1421
1422 2013-08-19  Pavel Raiskup  <praiskup@redhat.com>
1423
1424         Minor fix in the testsuite.
1425         * tests/T-cd.at: sort the 'tar cf' output.
1426
1427 2013-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>
1428
1429         Improve error diagnostics
1430         * src/names.c (file_list_name): New static function.
1431         (add_file_id): If a filelist is being read twice, print the names
1432         of the files that caused it.
1433         * tests/T-rec.at: New test case.
1434         * tests/Makefile.am: Add new file.
1435         * tests/testsuite.at: Include new file.
1436
1437 2013-08-16  Sergey Poznyakoff  <gray@gnu.org.ua>
1438
1439         Revamp initial name collection functions to ensure proper
1440         argument ordering.
1441         * src/names.c (NELT_NOOP): New constant
1442         (name_elt) <next,prev>: New members.
1443         (name_array,allocated_entries,entries,scanned): Remove.
1444         (check_name_alloc): Remove function.
1445         (name_elt_alloc): New static.
1446         (name_list_adjust,name_list_advance): New functions.
1447         (name_add_name,name_add_dir)
1448         (name_add_file): Use new allocation functions.
1449         (read_next_name): Advance list head pointer as necessary
1450         before returning.
1451         (name_next_elt): Read elements from list.
1452         * tests/T-cd.at: New file.
1453         * tests/T-mult.at: New file.
1454         * tests/T-nest.at: New file.
1455         * tests/Makefile.am: Add new testcases.
1456         * tests/testsuite.at: Likewise.
1457
1458         Don't treat attempts to read an already read file list as
1459         fatal errors.
1460         * src/names.c (add_file_id): Report error and return 1 if the file
1461         has already been read.
1462         (read_next_name): Don't try to open file if add_file_id returns 1.
1463         (name_next_elt): Simplify conditional.
1464
1465         Minor change.
1466         * src/names.c (name_next_elt): Simplify conditional.
1467
1468 2013-08-15  Pavel Raiskup  <praiskup@redhat.com>
1469
1470         Fix use of uninitialized memory
1471         * src/names.c (name_add_file): Initialize the ep->v.file.fp
1472         pointer
1473         after structure allocation.
1474
1475 2013-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
1476
1477         Minor changes
1478         * src/names.c (handle_option): Use program_invocation_short_name
1479         instead of the constant string.
1480         (read_next_name): Remove unused variable.
1481
1482 2013-08-04  Sergey Poznyakoff  <gray@gnu.org.ua>
1483
1484         Update the docs.
1485         * doc/tar.texi: Parsing of the options found in the file list
1486         follows the same rules as for command line.  Remove the obsolete
1487         description.  This complements 26538c9b.
1488
1489         Fix interaction of --verbose and --append.
1490         * src/buffer.c (_open_archive): don't overwrite existing archive
1491         if given the --verify option.
1492         * tests/append04.at: New file.
1493         * tests/Makefile.am: Add new testcase.
1494         * tests/testsuite.at: Add new testcase.
1495         * THANKS: Update.
1496
1497         Bugfix.
1498         * src/names.c (read_name_from_file): Fix a typo. Remove
1499         unused variable.
1500
1501         Reduce memory consumption when handling the -T option.
1502         The commit cdb27293 made the -T option more flexible, but
1503         incurred a very considerable memory overhead by storing
1504         all file names in the argument array.  In case of very
1505         big file lists this caused tar to run out of memory.  This
1506         was reported by Christian Wetzel <wetzel@phoenix-pacs.de>
1507         on March 14, 2013
1508         (http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00018.html).
1509         On the other hand, Michal Å½eidl discovered that tar malfunctioned
1510         when given empty file lists or lists with the trailing newline
1511         missing in the last entry.  This was reported by Pavel Raiskup
1512         on July 23
1513         (http://lists.gnu.org/archive/html/bug-tar/2013-07/msg00009.html
1514         and
1515         msg00010.html).
1516         This change fixes both issues.
1517         * src/common.h (name_add_file,request_stdin): New prototype.
1518         (more_options): New prototype.
1519         * src/names.c (NELT_FILE): New entry type.
1520         (name_elt) <file>: New union member.
1521         (name_add_file): New function.
1522         (read_name_from_file): New function, a rewrite of
1523         the same function from tar.c
1524         (read_next_name,copy_name): New static functions.
1525         (name_next_elt): Handle NELT_FILE entries.
1526         * src/tar.c (request_stdin): Make extern.
1527         (read_name_from_file,add_file_id)
1528         (update_argv): Removed.
1529         (parse_opt): Change handling of the -T option.
1530         (more_options): New function.
1531         * tests/T-null.at: Rewrite test.
1532         * tests/T-zfile.at: New file.
1533         * tests/T-nonl.at: New file.
1534         * tests/Makefile.am: Add new testcases.
1535         * tests/testsuite.at: Likewise.
1536         * THANKS: Update.
1537
1538 2013-06-29  Sergey Poznyakoff  <gray@gnu.org.ua>
1539
1540         Fix the compatibility check for the --occurrence option.
1541         * src/tar.c (SUBCL_OCCUR): New class.
1542         (subcommand_class): Update.
1543         (decode_options): Accept the --occurrence option
1544         with any subcommand from the SUBCL_OCCUR class.
1545
1546 2013-06-29  Pavel Raiskup  <praiskup@redhat.com>
1547
1548         testsuite: do not resist on file order in archive
1549         On my Fedora 19 box, the exclude08 & exclude11 tests failed before
1550         this fix.  The reason was that the directory traversing chosen the
1551         file order differently than the testsuite expected.
1552         * tests/exclude08.at: Sort the tarball content output.
1553         * tests/exclude09.at: Likewise.
1554         * tests/exclude10.at: Likewise.
1555         * tests/exclude11.at: Likewise.
1556         * tests/exclude12.at: Likewise.
1557         * tests/exclude13.at: Likewise.
1558         * tests/exclude14.at: Likewise.
1559         * tests/exclude15.at: Likewise.
1560         * tests/exclude16.at: Likewise.
1561
1562 2013-06-29  Sergey Poznyakoff  <gray@gnu.org.ua>
1563
1564         Improve checks for incompatible options.
1565         * src/common.h (READ_LIKE_SUBCOMMAND): Remove define.
1566         * src/tar.c (IS_SUBCOMMAND_CLASS): New macro.
1567         (decode_options): Use IS_SUBCOMMAND_CLASS in checking
1568         option compatibility.
1569         Accept the --verify option only with subcommands that
1570         write to the archive.
1571         * tests/opcomp01.at: New test case.
1572         * tests/opcomp02.at: New test case.
1573         * tests/opcomp03.at: New test case.
1574         * tests/opcomp04.at: New test case.
1575         * tests/opcomp05.at: New test case.
1576         * tests/opcomp06.at: New test case.
1577         * tests/Makefile.am: Add new testcases.
1578         * tests/testsuite.at: Likewise.
1579
1580 2013-06-28  Paul Eggert  <eggert@cs.ucla.edu>
1581
1582         tar: port to Mingw Shell
1583         * src/extract.c (extract_symlink) [!HAVE_SYMLINK]:
1584         Fix typo by replacing WARN_SYMBOLIC_CAST with WARN_SYMLINK_CAST.
1585         Problem reported by kaka in
1586         <http://lists.gnu.org/archive/html/bug-tar/2013-06/msg00008.html>.
1587
1588 2013-05-06  Paul Eggert  <eggert@cs.ucla.edu>
1589
1590         maint: revert previous change
1591         It wasn't actually needed.  Reported by Stefano Lattarini in
1592         <http://lists.gnu.org/archive/html/bug-tar/2013-04/msg00041.html>.
1593         * configure.ac (AM_GNU_GETTEXT_VERSION): Decrease from 0.18.2
1594         back to 0.16.
1595
1596 2013-04-25  Paul Eggert  <eggert@cs.ucla.edu>
1597
1598         maint: port to bleeding-edge Automake by assuming Gettext 0.18.2
1599         Reported by Stefano Lattarini in
1600         <http://lists.gnu.org/archive/html/bug-tar/2013-04/msg00009.html>.
1601         * configure.ac (AM_GNU_GETTEXT_VERSION): Increase from 0.16
1602         to 0.18.2.
1603         README-alpha says that we do not make any efforts to accommodate
1604         older versions of Gettext.
1605
1606         tar: port to --without-xattrs --enable-gcc-warnings
1607         Reported by Pavel Raiskup in
1608         <http://lists.gnu.org/archive/html/bug-tar/2013-03/msg00029.html>.
1609         * src/xattrs.c (xattrs__fd_set) [!HAVE_XATTRS]: Omit.
1610
1611         doc: port to texinfo 5
1612         * doc/tar.texi (Reports, assumptions, Mixing):
1613         Put FIXMEs at line start.
1614
1615 2013-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
1616
1617         Continue extracting from a separate volume after skipping a
1618         partial member.
1619         Reported by Göran Udeborg on 2013-03-09.
1620         * src/extract.c (extract_skip): New function.
1621         (prepare_to_extract): Set extractor to extract_skip if starting
1622         at a partial member.
1623
1624         Fix interaction of various --exclude-tag options with
1625         --listed-incremental.
1626         * src/incremen.c (procdir): Set directory->tagfile in
1627         the exclusion_tag_contents case.
1628         (makedumpdir): Mark all entries as ignored if directory->tagfile
1629         is set.
1630         Free new_dump before returning.
1631         (maketagdumpdir): New function.
1632         (scan_directory): If directory->children is set to
1633         NO_CHILDREN and directory->tagfile is set, create a
1634         dumpdir consisting of the tagfile only.
1635         * tests/exclude08.at: New testcase.
1636         * tests/exclude09.at: New testcase.
1637         * tests/exclude10.at: New testcase.
1638         * tests/exclude11.at: New testcase.
1639         * tests/exclude12.at: New testcase.
1640         * tests/exclude13.at: New testcase.
1641         * tests/exclude14.at: New testcase.
1642         * tests/exclude15.at: New testcase.
1643         * tests/exclude16.at: New testcase.
1644         * tests/Makefile.am: Add new tests.
1645         * tests/testsuite.at: Include new tests.
1646         * tests/atlocal.in (mkexcltest): New function.
1647         * tests/chtype.at: Update keywords.
1648         * tests/filerem01.at: Likewise.
1649         * tests/filerem02.at: Likewise.
1650         * tests/incremental.at: Likewise.
1651         * tests/multiv04.at: Likewise.
1652
1653 2013-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1654
1655         tar: remove lint
1656         * lib/wordsplit.c (_wsplit_error): Mark with printf attribute.
1657         (expvar): "Use" defstr to pacify GCC.
1658         * src/system.c (xexec): Now _Noreturn, to pacify GCC.
1659         (run_decompress_program): Add cast to pacify GCC.
1660         (sys_exec_command, sys_exec_info_script,
1661         sys_exec_checkpoint_script):
1662         Remove unused variables.
1663
1664 2013-02-10  Sergey Poznyakoff  <gray@gnu.org.ua>
1665
1666         Pass command line arguments to external commands.
1667         Any option taking a command name as its argument accepts
1668         additional arguments as well.
1669         * lib/wordsplit.c: New file.
1670         * lib/wordsplit.h: New file.
1671         * lib/Makefile.am: Add new files.
1672         * src/system.c (xexec): New function.
1673         (run_decompress_program): Use wordsplit.
1674         (sys_child_open_for_compress,sys_exec_command)
1675         (sys_exec_info_script)
1676         (sys_exec_checkpoint_script): Use xexec to invoke external
1677         command.
1678         * NEWS: Update.
1679         * doc/tar.texi: Update.
1680
1681 2013-01-29  Nathan Stratton Treadway  <nathanst@ontko.com>
1682
1683         tar: improve compile-time diagnostics
1684         * src/misc.c (sysinttostr, strtosysint): Improve #error wording.
1685
1686 2013-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1687
1688         tar: improve quality of diagnostics with incrementals
1689         Inspired by a prototype by Nathan Stratton Treadway in
1690         <http://lists.gnu.org/archive/html/bug-tar/2013-01/msg00000.html>.
1691         * src/incremen.c (read_num): Rewrite by merging read_negative_num
1692         and read_unsigned_num.  Use strtosysint rather than rolling this
1693         stuff ourselves.  Change return type to bool.  All uses changed.
1694         (read_negative_num, read_unsigned_num): Remove.
1695         (read_num, read_timespec, read_incr_db_2): Improve quality of
1696         diagnostics, e.g., by supplying byte offset of error.
1697
1698 2013-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1699
1700         tar: fix bug with sparse files with effective size of 8 GiB
1701         or more
1702         Reported by Pavel Raiskup in
1703         <http://lists.gnu.org/archive/html/bug-tar/2013-01/msg00001.html>.
1704         * NEWS: Document the fix.
1705         * src/sparse.c (pax_start_header): New function.
1706         (pax_dump_header_0, pax_dump_header_1): Use it.
1707
1708 2012-12-31  Paul Eggert  <eggert@cs.ucla.edu>
1709
1710         maint: update copyrights for 2013 and as per current GNU standards
1711
1712         maint: remove unnecessary file
1713         * src/configure.in: Remove.  This file has been obsolete for
1714         a while.
1715
1716 2012-12-24  Paul Eggert  <eggert@cs.ucla.edu>
1717
1718         maint: don't enable warnings by default unless GCC 4.6 or later
1719         * configure.ac (gl_GCC_VERSION_IFELSE): New macro, from coreutils.
1720         (gl_gcc_warnings): By default, disable warnings for GCC versions
1721         before 4.6.  This works around a failure when building from git on
1722         Ubuntu 10, reported privately by Nathan Stratton Treadway.
1723
1724 2012-12-23  Paul Eggert  <eggert@cs.ucla.edu>
1725
1726         Handle incremental format 2 with negative numbers, too.
1727         * src/incremen.c (read_unsigned_num): Last arg is intmax_t *, not
1728         uintmax_t, for consistency with other readers.  All callers
1729         changed.
1730         Avoid signed integer overflow.
1731         (read_num):
1732
1733         Fix some problems with negative and out-of-range integers.
1734         Original problem reported for HP-UX LVM v2.2 by Michael White in
1735         <http://lists.gnu.org/archive/html/bug-tar/2012-10/msg00000.html>.
1736         This patch fixes some other gotchas that I noticed.
1737         * gnulib.modules: Add extern-inline.
1738         * src/common.h: Use _GL_INLINE_HEADER_BEGIN,
1739         _GL_INLINE_HEADER_END.
1740         (COMMON_INLINE, max, min): New macros.
1741         (represent_uintmax, valid_timespec): New inline functions.
1742         (SYSINT_BUFSIZE): New constant.
1743         (sysinttostr, strtosysint, decode_timespec): New decls.
1744         * src/create.c (start_private_header): Silently bring the time_t
1745         value into range; it is now the caller's responsibility to deal
1746         with any overflow error.  Use uid 0 and gid 0 rather than the
1747         user's uid/gid, since the faked header isn't "owned" by the user
1748         and the uid/gid could in theory be out of range.  Leave major and
1749         minor zeroed.
1750         (FILL): Remove.
1751         (write_gnu_long_link): Let start_private_header zero things out.
1752         * src/create.c (write_gnu_long_link, write_extended):
1753         * src/xheader.c (xheader_write_global):
1754         Use start_time, not current time; no point hammering on the clock.
1755         * src/compare.c (diff_multivol): Check that offset, size are
1756         in range.
1757         * src/incremen.c (read_incr_db_01, write_directory_file_entry):
1758         Allow negative time_t, dev_t, and ino_t.
1759         * src/list.c (max): Remove (moved to common.h).
1760         (read_header): Check that size is in range.
1761         (from_header): Return intmax_t, not uintmax_t, to allow negative.
1762         All callers changed.  At compile time, check assumptions about
1763         intmax_t and uintmax_t.  Use bool for booleans.  Avoid overflow
1764         hassles on picky hosts.
1765         (mode_from_header): Last arg is now bool *, not unsigned *.
1766         All callers changed.
1767         (simple_print_header): Do not assume UID, GID fit in 'long'.
1768         * src/list.c (from_header):
1769         * src/xheader.c (out_of_range_header):
1770         Arg is now a plain minimum value, not minus minval converted to
1771         uintmax_t.  All callers changed.
1772         * src/misc.c (COMMON_INLINE): New macro.
1773         (sysinttostr, strtosysint, decode_timespec): New functions.
1774         * src/sparse.c (oldgnu_add_sparse, oldgnu_fixup_header)
1775         (star_fixup_header):
1776         Check for offset overflow.
1777         (decode_num): Clear errno before calling strtoumax.
1778         * src/tar.c (expand_pax_option): Don't discard nanoseconds.
1779         * src/xheader.c (assign_time_option): Allow negative time_t.
1780         (decode_record): Simplify, since out-of-range string is guaranteed
1781         to produce a value exceeding len_max.
1782         (xheader_read): Last arg is off_t, not size_t.
1783         Caller should diagnose negative arg, as needed.
1784         Check that it's in range.
1785         (enum decode_time_status): Remove.
1786         (_decode_time): Remove, folding into decode_time.
1787         (decode_time): Return bool, not enum decode_time_status.
1788         Rely on decode_timespec to do most of the work.
1789         (code_signed_num): New function.
1790         (code_num): Use it.
1791         (decode_signed_num): New function.
1792         (decode_num): Use it.
1793         (gid_coder, gid_decoder, uid_coder, uid_decoder,
1794         sparse_map_decoder)
1795         (sparse_map_decoder): Code and decode negative values.
1796         (sparse_map_decoder): Improve check for out-of-range values.
1797         * tests/time01.at: New file.
1798         * tests/Makefile.am (TESTSUITE_AT): Add it.
1799         * tests/testsuite.at: Include it.
1800
1801 2012-12-22  Paul Eggert  <eggert@cs.ucla.edu>
1802
1803         Port use of mkdirat etc. to Solaris 10.
1804         * gnulib.modules (fchmodat, fchownat, fstatat, mkdirat, unlinkat):
1805         Add.  These were split out in gnulib, so we now need to request
1806         them separately.  mkdirat, for example, is not in Solaris 10.
1807
1808         Port ACL configuration to Solaris 10.
1809         * configure.ac (with_posix_acls): Fix misspellings.
1810         Stop checking at the first failure, to speed up 'configure'.
1811
1812 2012-12-19  Paul Eggert  <eggert@cs.ucla.edu>
1813
1814         tar: remove unused externs, or make them static
1815         * src/buffer.c (record_buffer_aligned, flush_write_ptr,
1816         flush_read_ptr)
1817         (duration):
1818         * src/list.c (recent_global_header):
1819         * src/unlink.c (deferred_unlink_delay):
1820         * src/transform.c (transform_flags):
1821         * src/xattrs.c (acl_get_file_at, acl_set_file_at,
1822         file_has_acl_at):
1823         Now static.
1824         * src/common.h (rmt_command_option): Remove; unused.
1825         * src/tar.c (check_links_option, allocated_archive_names):
1826         Move decls here from common.h; these are now static.
1827
1828         * .gitignore: Regenerate.
1829
1830         build: new configure option --enable-gcc-warnings
1831         This has a similar meaning as in other GNU applications
1832         such as coreutils and Emacs.
1833         * NEWS: Document it.
1834         * .gitignore: Remove redundant build-aux.
1835         Remove gnu, since gnu/Makefile.am is now in git.
1836         Add gnu/.gitignore, gnu/charset.alias, gnu/*.h, gnu/*/ to cover
1837         autogenerated files.
1838         * bootstrap.conf (gnulib_mk): Remove.
1839         * configure.ac: Add support for --enable-gcc-warnings,
1840         taken from coreutils and simplified.
1841         * gnu/Makefile.am: New file.  Formerly this was autogenerated,
1842         but the autogenerated file has been renamed to gnulib.mk,
1843         its usual name when bootstrapping from gnulib.
1844         This way, AM_CFLAGS can incorporate warning options.
1845         * gnulib.modules: Add manywarnings.
1846         * lib/Makefile.am, src/Makefile.am (AM_CFLAGS): New macro,
1847         incorporating warning options.
1848         * lib/attr-xattr.in.h (ENOATTR): New macro, if not already
1849         defined.
1850         * src/buffer.c (magic): Don't rely on incomplete initializers.
1851         * src/common.h (report_difference): Add printf format attribute.
1852         * src/system.c (sys_exec_command, sys_exec_info_script)
1853         (sys_exec_checkpoint_script):
1854         * src/tar.c (update_argv):
1855         Add casts to char * to pacify GCC warnings about using string
1856         literals in a char * context.
1857         * src/xattrs.c, src/xattrs.h (xattrs_clear_setup):
1858         Declare parameters as (void), not ().
1859         * src/xheader.c (xheader_format_name): Initialize pptr to null,
1860         to pacify GCC.  Remove unnecessary test of nptr versus null.
1861
1862         tar: don't truncate diagnostic
1863         * src/list.c (from_header): Fix buffer size calculation when
1864         generating a diagnostic.
1865
1866 2012-12-03  Sergey Poznyakoff  <gray@gnu.org.ua>
1867
1868         Bugfix.
1869         * tests/Makefile.am: Fix double AM_CPPFLAGS
1870
1871 2012-12-01  Sergey Poznyakoff  <gray@gnu.org.ua>
1872
1873         Use AM_CPPFLAGS instead of INCLUDES.
1874
1875 2012-11-19  Sergey Poznyakoff  <gray@gnu.org.ua>
1876
1877         Housekeeping.
1878         * NEWS: Mention the support for POSIX ACLs, extended
1879         attributes and SELinux context.
1880         * THANKS: List James Antill and Pavel Raiskup.
1881
1882         Fix indentation.
1883
1884 2012-11-19  Pavel Raiskup  <praiskup@redhat.com>
1885
1886         Allow to store/extract '=' character in xattr keyword
1887         * src/xheader.c (xattr_decode_keyword)
1888         (xattr_encode_keyword): New functions.
1889         (xheader_print_n,xattr_decoder): Use them.
1890         * tests/xattr05.at: New test case.
1891         * tests/Makefile.am: Add new test case.
1892         * tests/testsuite.at: Likewise.
1893
1894         Bugfixes.
1895         * configure.ac: Avoid linking against -lacl when
1896         --without-posix-acls is given.
1897         * tests/selacl01.at: Call restorecon
1898         * tests/selnx01.at: Likewise.
1899         * tests/testsuite.at (AT_SELINUX_UTILS_PREREQ): Likewise.
1900         (AT_SELINUX_PREREQ,AT_ACLS_PREREQ): Use the right _PREREQ macros.
1901
1902         Fix bootstrapping.
1903         * bootstrap (gnulib_extra_files): Remove $build_aux/missing
1904
1905 2012-11-19  Sergey Poznyakoff  <gray@gnu.org.ua>
1906
1907         Various fixes.
1908         * src/xattrs.c: Don't mix variable declarations and statements.
1909         Use proper data types.  Remove improper use of const qualifiers.
1910         Use x2nrealloc to reallocate memory buffers.
1911
1912 2012-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>
1913
1914         Minor change.
1915         * src/xattrs.c: Fix indentation. Fix copyleft statement, promote
1916         to GPLv3+.
1917         * src/xattrs.h: Likewise
1918
1919 2012-11-18  Pavel Raiskup  <praiskup@redhat.com>
1920
1921         Add SELinux context store/restore/list support.
1922         * gnulib.modules: Add selinux-at.
1923         * src/Makefile.am (tar_LDADD): Add LIB_SELINUX.
1924         * src/create.c (start_header, dump_file0): Handle selinux
1925         contexts.
1926         * src/extract.c (delayed_set_stat) <cntx_name>: New member.
1927         (delayed_link) <cntx_name>: New member.
1928         (set_stat, delay_set_stat)
1929         (apply_nonancestor_delayed_set_stat): Handle selinux contexts.
1930         * src/tar.c: New options: "--selinux", "--no-selinux".
1931         (tar_stat_destroy): Free cntx_name.
1932         * src/tar.h (tar_stat_info) <cntx_name>: New member.
1933         * src/xattrs.c (xattrs_selinux_get)
1934         (xattrs_selinux_set): New functions.
1935         (xattrs_print_char): Honor selinux_context_option.
1936         (xattrs_print): Print selinux context.
1937         * src/xheader.c: Handle new keyword "RHT.security.selinux".
1938         * tests/Makefile.am: Add new tests.
1939         * tests/testsuite.at: Likewise.
1940         * tests/selacl01.at: New test.
1941         * tests/selnx01.at: New test.
1942
1943         Support for POSIX ACLs
1944         * configure.ac: Check whether ACLs are available on the
1945         host system.
1946         * gnulib.modules: Add acl
1947         * src/create.c (start_header): Store ACLs when creating
1948         a POSIX archive.
1949         (dump_file0): Handle ACLs.
1950         * src/extract.c (delayed_set_stat) <acls_a_ptr, acls_a_len>
1951         <acls_d_ptr, acls_d_len>: New members.
1952         (delayed_link): Likewise.
1953         (set_stat,delay_set_stat)
1954         (apply_nonancestor_delayed_set_stat): Set ACLs.
1955         * src/tar.c: New options: "--acls", "--no-acls"
1956         (tar_stat_destroy): Free acls_a_ptr and acls_d_ptr fields.
1957         * src/tar.h (tar_stat_info) <acls_a_ptr, acls_a_len>
1958         <acls_d_ptr, acls_d_len>: New members.
1959         * src/xattrs.c (xattrs_acls_get, xattrs_acls_set): New functions.
1960         * src/xheader.c: Support new keywors: "SCHILY.acl.access" and
1961         "SCHILY.acl.default".
1962         * tests/Makefile.am: Add new tests.
1963         * tests/testsuite.at: Likewise.
1964         * tests/acls01.at: New test.
1965         * tests/acls02.at: New test.
1966
1967         Add basic support for extended attributes.
1968         * src/Makefile.am: Add xattrs.[ch]
1969         * src/xattrs.c: New file.
1970         * src/xattrs.h: New file.
1971         * src/common.h (READ_LIKE_SUBCOMMAND): New define.
1972         (selinux_context_option, acls_option, xattrs_option): New globals.
1973         (xheader_xattr_init, xheader_xattr_free)
1974         (xheader_xattr_copy, xheader_xattr_add): New protos.
1975         (WARN_XATTR_WRITE): New mask.
1976         * src/create.c (start_header): Handle xattrs pairs if in POSIX
1977         format.
1978         (dump_file0): Handle extended attributes.
1979         * src/extract.c (delayed_set_stat,delayed_link) <xattr_map_size>
1980         <xattr_map>: New members.
1981         (set_xattr): New static function.
1982         (open_output_file): Accept an additional argument indicating
1983         whether the file has already been created.
1984         (set_stat,delay_set_stat)
1985         (apply_nonancestor_delayed_set_stat)
1986         (extract_file): Handle extended attributes.
1987         * src/list.c (decode_header, simple_print_header): Display
1988         extended attributes.
1989         * src/tar.c: New options --xattrs, --no-xattrs, --xattrs-include,
1990         --xattrs-exclude
1991         (tar_stat_destroy): Free the xattr_map storage.
1992         * src/tar.h (xattr_array): New struct.
1993         (tar_stat_info) <xattr_map_size, xattr_map>: New members.
1994         * src/warning.c: New warning control keyword "xattr-write".
1995         * src/xheader.c (xheader_xattr_init)
1996         (xheader_xattr_free, xheader_xattr_add)
1997         (xheader_xattr_copy): New functions.
1998         (struct xhdr_tab) <prefix>: New member.
1999         (locate_handler): Permit selecting the keyword based on its
2000         prefix.
2001         (xheader_protected_pattern_p)
2002         (xheader_protected_keyword_p): Likewise.
2003         (xattr_coder, xattr_decoder): New functions.
2004         (xhdr_tab): Reflect the changes to struct xhdr_tab.
2005         New keyword "SCHILY.xattr".
2006         * tests/Makefile.am: Add new tests.
2007         * tests/testsuite.at: Likewise.
2008         (AT_CHECK_UTIL, AT_XATTRS_UTILS_PREREQ)
2009         (AT_CAPABILITIES_UTILS_PREREQ, AT_XATTRS_PREREQ): New defuns.
2010         * tests/xattr01.at: New test.
2011         * tests/xattr02.at: New test.
2012         * tests/xattr03.at: New test.
2013         * tests/xattr04.at: New test.
2014         * tests/capabs_raw01.at: New test.
2015
2016 2012-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>
2017
2018         Prepare for implementing extended attribute support.
2019         This patch adds *xattr() stubs in case extended attribute
2020         support is
2021         not present and implements the *attrat() family of functions.
2022         Based
2023         on the patch by Pavel Raiskup <pavel@raiskup.cz> for gnulib.
2024         * acinclude.m4 (TAR_HEADERS_ATTR_XATTR_H): New defun.
2025         * configure.ac: Call TAR_HEADERS_ATTR_XATTR_H
2026         * lib/Makefile.am: Add xattr-at.[ch], distribute attr-xattr.in.h
2027         [!TAR_COND_XATTR_H]: Build attr/xattr.h
2028         * lib/attr-xattr.in.h: New file.
2029         * lib/xattr-at.c: New file.
2030         * lib/xattr-at.h: New file.
2031
2032 2012-11-14  Sergey Poznyakoff  <gray@gnu.org.ua>
2033
2034         Fix creation of incremental archives when a subdirectory becomes
2035         a mountpoint.
2036         When used with --listed-incremental and --one-file-system, tar
2037         was unable to cope with directories that had once been part of the
2038         dumped system and became separate mount points afterward.  The bug
2039         has been reported and a fix proposed by Nathan Stratton Treadway.
2040         * src/incremen.c (procdir): If one_file_system_option is in
2041         effect,
2042         clear out dumpdir info from the directory.
2043         * tests/Makefile.am: Add new testcase.
2044         * tests/listed05.at: New testcase.
2045         * tests/testsuite.at (AT_PRIVILEGED_PREREQ): New macro.
2046         include listed05.at.
2047         * THANKS: Update.
2048
2049 2012-07-27  Jim Meyering  <jim@meyering.net>
2050
2051         maint: try to avoid unwanted chatter in ChangeLog
2052         * bootstrap.conf: Do not alter ChangeLog if it already exists.
2053
2054 2012-07-26  Paul Eggert  <eggert@cs.ucla.edu>
2055
2056         doc: improve discussion of compressed archives
2057         * doc/tar.texi (gzip): Don't claim that -I 'gzip --best' works.
2058         Problem reported by Davide Brini in
2059         <http://lists.gnu.org/archive/html/bug-tar/2012-07/msg00025.html>.
2060         Also, improve some of the surrounding text.
2061         This file is a placeholder. It will be replaced with the actual
2062         ChangeLog
2063         by make dist.  Run make ChangeLog if you wish to create it
2064         earlier.
2065
2066 2012-06-27  Paul Eggert  <eggert@cs.ucla.edu>
2067
2068         tests: fix permissions-assumption bug in test
2069         * tests/owner.at: Don't assume umask is 022.
2070         Reported by Pavel Raiskup in
2071         <http://lists.gnu.org/archive/html/bug-tar/2012-06/msg00015.html>.
2072
2073         tar: don't assume root is uid 0
2074         This is not true for Tandem NonStop Kernel.  See Joachim Schmitz's
2075         comment in <http://bugs.gnu.org/10305#111>.
2076         * gnulib.modules: Add root-uid.
2077         * src/extract.c: Include <root-uid.h>.
2078         (extr_init): Don't assume root is uid 0.
2079
2080 2012-04-25  Paul Eggert  <eggert@cs.ucla.edu>
2081
2082         * src/compare.c (diff_dumpdir): Omit useless 'stat'.
2083
2084         * doc/tar.texi (Option Summary): Fix xref typo.
2085         Reported by Nathan Stratton Treadway in
2086         <http://lists.gnu.org/archive/html/bug-tar/2012-04/msg00035.html>.
2087         This file is a placeholder. It will be replaced with the actual
2088         ChangeLog
2089         by make dist.  Run make ChangeLog if you wish to create it
2090         earlier.
2091
2092 2012-03-29  Sergey Poznyakoff  <gray@gnu.org.ua>
2093
2094         Fix unrecognized option.
2095         * src/tar.c (parse_opt): Handle OLD_ARCHIVE_OPTION.
2096
2097 2012-03-11  Paul Eggert  <eggert@cs.ucla.edu>
2098
2099         tar: remove lint
2100         This lint was found by GCC 4.6.2 on Fedora 15 x86-64.
2101         * src/buffer.c (buffer_write_global_xheader, mv_end,
2102         set_start_time)
2103         (compute_duration, print_total_stats, flush_read, flush_write):
2104         * src/checkpoint.c (checkpoint_finish_compile):
2105         * src/list.c (test_archive_label):
2106         * src/misc.c (chdir_count):
2107         * src/names.c (const):
2108         * src/unlink.c (finish_deferred_unlinks):
2109         Define with (void) instead of with (), for slightly-better C type
2110         checking and to avoid a GCC warning.
2111         * src/compare.c (diff_dumpdir):
2112         * src/tar.c (parse_owner_group): Remove unused local.
2113         * src/misc.c (chdir_do):
2114         * src/tar.c (add_exclude_array): Rename local to avoid shadowing.
2115         (LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
2116         Define only if needed.
2117         * src/update.c (update_archive): Initialize a local; this fixes
2118         what appears to be a real bug.
2119
2120 2012-02-14  Paul Eggert  <eggert@cs.ucla.edu>
2121
2122         doc: suggest Bash for large-fd script
2123         * doc/tar.texi (Multi-Volume Archives): Suggest Bash for shell
2124         script that might use >&10.  Problem reported by Edward F
2125         Eaglehouse in
2126         <http://lists.gnu.org/archive/html/bug-tar/2012-02/msg00002.html>.
2127
2128 2012-01-18  Paul Eggert  <eggert@cs.ucla.edu>
2129
2130         tar: quote 'like this', not `like this'
2131         This fixes some test failures recently introduced by gnulib
2132         updates
2133         prompted by recent changes to the GNU coding standards,
2134         which now advise to use quotes 'like this' or "like this"
2135         rather than `like this'.
2136         * NEWS: Document this.
2137         * README, README-hacking, doc/Makefile.am, scripts/backup.in:
2138         * scripts/backup.sh.in, scripts/dump-remind.in:
2139         * src/buffer.c, src/checkpoint.c, src/create.c, src/incremen.c:
2140         * src/misc.c, src/names.c, src/sparse.c, src/transform.c:
2141         * tests/incr02.at, tests/incremental.at, tests/multiv08.at:
2142         * tests/sparse04.at, tests/star/README, tests/update01.at:
2143         Quote 'like this' in comments.
2144         * src/tar.h:
2145         Quote "like this" in comments, when quoting English phrases rather
2146         than code.
2147         * configure.ac:
2148         * scripts/xsparse.c (get_var, read_xheader, main):
2149         * src/compare.c (diff_archive):
2150         * src/extract.c (prepare_to_extract):
2151         * src/tar.c (request_stdin, tar_set_quoting_style, doc, options)
2152         (set_subcommand_option, report_textual_dates, parse_opt)
2153         (decode_options, main):
2154         * src/xheader.c (decx):
2155         Quote 'like this' in diagnostics.
2156         * doc/tar.texi (list, warnings, override)
2157         (Selecting Archive Members, quoting styles, after, hard links)
2158         (Sparse Recovery, Multi-Volume Archives, label):
2159         Adjust documentation to match new output.
2160         * tests/backup01.at, tests/incr01.at, tests/incr04.at:
2161         * tests/label04.at, tests/label05.at, tests/link03.at:
2162         * tests/listed02.at, tests/multiv03.at, tests/multiv05.at:
2163         * tests/rename01.at, tests/rename02.at, tests/rename03.at:
2164         * tests/volume.at:
2165         Adjust tests to match new quoting behavior.
2166
2167         tar: port --overwrite symlink test to GNU/Hurd
2168         Problem reported by Pino Toscano in
2169         <http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00040.html>.
2170         * gnulib.modules: Add fcntl-h, which defines
2171         HAVE_WORKING_O_NOFOLLOW.
2172         * src/extract.c (open_output_file): Use HAVE_WORKING_O_NOFOLLOW,
2173         not O_NOFOLLOW, when testing whther O_NOFOLLOW works.
2174         This file is a placeholder. It will be replaced with the actual
2175         ChangeLog
2176         by make dist.  Run make ChangeLog if you wish to create it
2177         earlier.
2178
2179 2012-01-11  Paul Eggert  <eggert@cs.ucla.edu>
2180
2181         tar: fix core dump with --index-file=bad_path
2182         * src/tar.c (decode_options): Exit cleanly if index file won't
2183         open.
2184         Problem reported by Khanh-Dang Nguyen Thu Lam in
2185         <http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00018.html>.
2186
2187 2012-01-06  Paul Eggert  <eggert@cs.ucla.edu>
2188
2189         tar: don't assume O_NONBLOCK is benign on regular files
2190         On Data Migration Facility (DMF), High Performance Storage System
2191         (HPSS),
2192         and presumably other file systems based on hierarchical storage,
2193         opening
2194         a regular file with O_NONBLOCK can cause later reads to fail with
2195         errno == EAGAIN.  We need the O_NONBLOCK to avoid some security
2196         races.
2197         Work around the problem by using fcntl to clear the O_NONBLOCK
2198         flag if I/O fails with that errno value.
2199         Problem reported by Vitezslav Cizek in
2200         <http://lists.gnu.org/archive/html/bug-tar/2012-01/msg00000.html>.
2201         * src/common.h (blocking_read, blocking_write): New decls.
2202         * src/misc.c (blocking_read, blocking_write): New functions.
2203         * src/compare.c (process_rawdata):
2204         * src/create.c (dump_regular_file):
2205         * src/extract.c (extract_file):
2206         * src/sparse.c (sparse_scan_file, sparse_extract_region):
2207
2208 2011-11-26  Sergey Poznyakoff  <gray@gnu.org.ua>
2209
2210         Fix --keep-old-files option.
2211         The regression was introduced by 8f390db9.  This patch implements
2212         additional
2213         option --skip-old-files, which silently skips members which
2214         would cause
2215         writing over existing files, and restores --keep-old-files to
2216         its traditional
2217         behavior.
2218         * NEWS: Update.
2219         * configure.ac: Update.
2220         * doc/tar.texi: Document the changes.
2221         * src/common.h (SKIP_OLD_FILES): New old_files mode.
2222         * src/extract.c (maybe_recoverable): Restore KEEP_OLD_FILES
2223         behavior.
2224         Handle SKIP_OLD_FILES.
2225         * src/tar.c: New option --skip-old-files.
2226         * tests/extrac18.at: New file.
2227         * tests/extrac19.at: New file.
2228         * tests/Makefile.am: Add new test cases.
2229         * tests/testsuite.at: Likewise.
2230
2231 2011-11-17  Sergey Poznyakoff  <gray@gnu.org.ua>
2232
2233         Warn about existing files in keep-old-files mode (complements
2234         8f390db9).
2235         This is controlled by "existing-file" warning code, which is off
2236         by default.
2237         * src/common.h (WARN_EXISTING_FILE): New warning code.
2238         (WARN_VERBOSE_WARNINGS): Add WARN_EXISTING_FILE.
2239         * src/extract.c (maybe_recoverable): warn about existing file
2240         if WARN_EXISTING_FILE is set.
2241         * src/warning.c: New warning type: "existing-file"
2242
2243         Fix the "Creating directory:" output
2244         * src/list.c (print_for_mkdir): don't use unquoted name length for
2245         computing its output width.
2246
2247 2011-11-15  Sergey Poznyakoff  <gray@gnu.org.ua>
2248
2249         Fix operation of --verify in conjunction with --listed-incremental
2250         * src/common.h (clear_directory_table): New proto.
2251         * src/incremen.c (clear_directory_table): New function.
2252         * src/compare.c (diff_dumpdir): Take a pointer to struct
2253         tar_stat_info as argument.
2254         Initialize its fd.
2255         (diff_archive): Update call to diff_dumpdir.
2256         (verify_volume): Call clear_directory_table.
2257
2258 2011-10-18  Paul Eggert  <eggert@cs.ucla.edu>
2259
2260         * doc/tar.texi (Option Summary, absolute): Document -P better,
2261         by describing how it deals with symbolic links on extraction.
2262
2263 2011-09-28  Paul Eggert  <eggert@cs.ucla.edu>
2264
2265         2011-09-27 Paul Eggert <eggert@cs.ucla.edu>
2266         * src/tar.c (stat_on_signal): Use SA_RESTART if available.
2267
2268 2011-09-20  Paul Eggert  <eggert@cs.ucla.edu>
2269
2270         * doc/tar.texi: Remove front- and back-cover texts.
2271         These are no longer needed for this manual, according to the
2272         GNU maintainers guide.  Update copyright date to 2011.
2273
2274 2011-09-19  Sergey Poznyakoff  <gray@gnu.org.ua>
2275
2276         Minor changes.
2277         * scripts/tar-snapshot-edit: License under GPLv3+.
2278         Remove trailing whitespace.
2279
2280 2011-09-19  Nathan Stratton Treadway  <nathanst+bugtar@ontko.com>
2281
2282         Minor changes.
2283         * doc/snapshot.texi: Clarify the use of nfs field in 0 and
2284         1 formats.
2285         Give more precise information about which versions of tar
2286         used each
2287         format.
2288
2289         Upgrade tar-snapshot-edit script.
2290         * scripts/tar-snapshot-edit: Update Perl syntax to work
2291         correctly with more recent versions of Perl.  (The original
2292         code worked with in the v5.8 timeframe but not with
2293         Perl v5.10.1 and later.)
2294         Add a "-c" option to check the snapshot file for invalid
2295         field values.
2296         Handle NFS indicator character ("+") in version 0 and 1 files.
2297         Preserve the original header/version line when editing version 1
2298         or 2 files.
2299         Tweak output formatting.
2300         * doc/tar-snapshot-edit.texi: Update documentation.
2301
2302 2011-08-13  Paul Eggert  <eggert@cs.ucla.edu>
2303
2304         tar: --owner and --group names and numbers
2305         The --owner and --group options now accept operands of the form
2306         NAME:NUM, so that you can specify both symbolic name and numeric
2307         ID for owner and group.  Also, in these options, NAME no longer
2308         needs to be present in the current host's user and group
2309         databases; this implements Debian enhancement request 136231
2310         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=136231> reported
2311         by Mark W. Eichin, communicated by Thayne Harbaugh to bug-tar in
2312         <http://lists.gnu.org/archive/html/bug-tar/2011-08/msg00001.html>.
2313         * NEWS, doc/tar.texi (Option Summary, override): Document
2314         enhancement.
2315         * src/common.h (group_name_option, owner_name_option): New decls.
2316         * src/create.c (start_header): Don't assume owner and group names
2317         are in current host database.
2318         * src/tar.c (parse_owner_group): New function, for parsing
2319         NAME:NUM.
2320         (parse_opt): Use it.
2321         (decode_options): Initialize owner_name_option, group_name_option.
2322         * tests/owner.at: New file, to test this enhancement.
2323         * tests/Makefile.am (TESTSUITE_AT): Add it.
2324         * tests/testsuite.at: Include it.
2325
2326         .gitignore: update
2327         * .gitignore: Add rmt.
2328         * lib/.gitignore: New file.
2329
2330 2011-07-30  Sergey Poznyakoff  <gray@gnu.org.ua>
2331
2332         Fix the --exclude-backups option.
2333         * src/tar.c (add_exclude_array): Take exclude option flags in its
2334         second argument.
2335         (parse_opt): Register backup_file_table with the EXCLUDE_WILDCARDS
2336         flag.
2337         * tests/exclude07.at: New testcase.
2338         * tests/Makefile.am (TESTSUITE_AT): Add testsuite.at.
2339         * tests/testsuite.at: Include exclude07.at.
2340
2341 2011-06-08  Paul Eggert  <eggert@cs.ucla.edu>
2342
2343         tar: simplify birthtime calculations
2344         * src/extract.c (same_birthtime): Remove.
2345         (extract_link, apply_delayed_links): Go back to using
2346         timestamp_cmp
2347         instead of same_birthtime, as this is a bit simpler.  This fix
2348         relies
2349         on an up-to-date gnulib.
2350
2351         tar: use birthtime rather than ctime when checking identity
2352         Without this fix, tar would sometimes mishandle the extraction of
2353         hard links to symbolic links.  Problem reported in
2354         <http://lists.gnu.org/archive/html/bug-tar/2011-06/msg00000.html>
2355         by Andreas Stolcke.
2356         * src/extract.c (struct delayed_link): Change ctime member
2357         to birthtime.
2358         (same_birthtime): New function.
2359         (create_placeholder_file, extract_link, apply_delayed_links):
2360         Use it to compare birthtimes (when available) instead of ctime.
2361
2362 2011-05-26  Paul Eggert  <eggert@cs.ucla.edu>
2363
2364         * doc/tar.texi (Old Options): Clarify distinction from short
2365         options.
2366         Adjust other parts of the manual to use examples that parse the
2367         same regardless of whether "-" is in front of the option clump.
2368         See
2369         <http://lists.gnu.org/archive/html/bug-tar/2011-05/msg00022.html>.
2370
2371 2011-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
2372
2373         Testsuite fix.
2374         * tests/sparse04.at: Use the -f option.
2375
2376         Version 1.26
2377         * NEWS, configure.ac: Update.
2378         * po/POTFILES.in: Remove paxexit.c (see bb971a1e).
2379
2380 2011-03-08  Paul Eggert  <eggert@cs.ucla.edu>
2381
2382         --atime-preserve=replace: fix correctness and performance bugs
2383         reported by Eric Blake in
2384         <http://lists.gnu.org/archive/html/bug-tar/2011-03/msg00000.html>.
2385         * src/compare.c (diff_file): Do not restore atime of size-zero
2386         files.
2387         * src/create.c (dump_file0): Likewise.  Also, do not restore atime
2388         when fd is zero, because that indicates a file we haven't opened.
2389
2390 2011-02-23  Paul Eggert  <eggert@cs.ucla.edu>
2391
2392         * doc/tar.texi: Adjust example commands and output for accuracy.
2393         The original problem was reported by Michael Witten in
2394         <http://lists.gnu.org/archive/html/bug-tar/2011-02/msg00033.html>.
2395
2396 2011-02-16  Paul Eggert  <eggert@cs.ucla.edu>
2397
2398         tar: if (p) free (p); -> free (p);
2399         There is no longer (since SunOS 4) any need to guard against
2400         free (NULL), so replace each "if (p) free (p);" with "free (p);".
2401         From Jim Meyering in
2402         <http://lists.gnu.org/archive/html/bug-tar/2011-01/msg00026.html>.
2403         * src/incremen.c (scan_directory, read_directory_file): As above.
2404         (try_purge_directory): Likewise.
2405         * src/list.c (read_header): Likewise.
2406         * src/misc.c (assign_string): Likewise.
2407
2408 2010-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>
2409
2410         Correctly store long sparse file names in PAX archives.
2411         * src/sparse.c (pax_dump_header_1): Make sure the created header
2412         name is
2413         shorter than NAME_FIELD_SIZE bytes.
2414         * tests/sparse04.at: New testcase.
2415         * tests/Makefile.am (TESTSUITE_AT): Add sparse04.at.
2416         * tests/testsuite.at: Include sparse04.at.
2417         * NEWS: Update.
2418
2419 2010-12-07  Paul Eggert  <eggert@cs.ucla.edu>
2420
2421         tests: make the truncate test smaller and less buggy (tiny change)
2422         Reported by Solar Designer in
2423         <http://lists.gnu.org/archive/html/bug-tar/2010-12/msg00003.html>.
2424         * tests/truncate.at: Use a smaller test case, and make its
2425         race condition less likely.
2426
2427 2010-11-27  Paul Eggert  <eggert@cs.ucla.edu>
2428
2429         tests: skip SIGPIPE-dependent tests in environments ignoring
2430         SIGPIPE
2431         Problem reported by Sven Joachim in
2432         <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00043.html>.
2433         * tests/remfiles01.at: Use AT_SIGPIPE_PREREQ.
2434         * tests/sigpipe.at: Likewise.
2435         * tests/testsuite.at (AT_SIGPIPE_PREREQ): New macro.
2436
2437 2010-11-25  Paul Eggert  <eggert@cs.ucla.edu>
2438
2439         tar: work around NetBSD and Tru64 symlink incompatibility
2440         with POSIX
2441         Problem reported by Bruno Haible in
2442         <http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00306.html>.
2443         * src/extract.c (maybe_recoverable):  Also treat EFTYPE (if
2444         defined)
2445         and ENOTSUP like ELOOP.
2446
2447 2010-11-24  Paul Eggert  <eggert@cs.ucla.edu>
2448
2449         tar: adjust to paxutils change: paxexit.c -> paxexit-status.c
2450         * lib/Makefile.am (libtar_a_SOURCES): paxexit.c renamed to
2451         paxexit-status.c.
2452
2453         tar: remove unused function dir_removed_diag
2454         * src/common.h (dir_removed_diag): Remove unused decl.
2455         * src/misc.c (dir_removed_diag): Remove unused function.
2456
2457 2010-11-23  Paul Eggert  <eggert@cs.ucla.edu>
2458
2459         tar: work around FreeBSD symlink incompatibility with POSIX
2460         * src/extract.c (maybe_recoverable): Treat EMLINK like ELOOP, for
2461         FreeBSD.  Problem reported by Christian Weisgerber in
2462         <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00080.html>.
2463
2464         * src/names.c: tar: fix bug with --one-file-system
2465         --listed-incremental
2466         Problem (and idea for fix) reported by Martin Weigel
2467         <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00071.html>.
2468         * src/common.h (is_individual_file): Remove decl.
2469         * src/create.c (dump_file0): Replace "is_individual_file (p)"
2470         with "top_level".
2471         * src/incremen.c (procdir): Replace "!is_individual_file
2472         (name_buffer)" with "st->parent".  Fix bug with --one-file-system
2473         and --listed-incremental.
2474         * src/names.c (individual_file_table, register_individual_file):
2475         (is_individual_file): Remove.  All uses removed.
2476
2477         tests: new test listed04 for --one-file-system
2478         --listed-incremental
2479         * tests/Makefile.am (TESTSUITE_AT): Add listed04.at.
2480         * tests/listed04.at: New file.
2481         * tests/testsuite.at: Include it.
2482
2483         scripts: fix option parsing
2484         Problem reported by Dennis Wydra in
2485         <http://lists.gnu.org/archive/html/bug-tar/2010-11/msg00082.html>.
2486         * scripts/backup.in: Accept "-l LEVEL".  Be more systematic about
2487         backslashes inside ``; it shouldn't matter for modern shells but
2488         it might matter for older ones.
2489         * scripts/restore.in: Likewise.
2490         * scripts/backup.in: Adjust implementation of -t/--time to match
2491         the new implementation of -l/--level.
2492
2493 2010-11-15  Sergey Poznyakoff  <gray@gnu.org.ua>
2494
2495         Issue a warning if the archive being compared contains transformed
2496         file names.
2497         * src/common.h (transform_program_p): New proto.
2498         * src/transform.c (transform_program_p): New function.
2499         * src/compare.c (verify_volume): Warn if the archive contains
2500         transformed file names.
2501
2502         Minor change.
2503         * doc/tar.texi: Reword the description of decompress-program.
2504
2505 2010-11-15  Paul Eggert  <eggert@cs.ucla.edu>
2506
2507         tar: fix --verify option, which broke in 1.24
2508         * NEWS: Document this.
2509         * src/compare.c (verify_volume): Decode the header before invoking
2510         diff_archive, as diff_archive no longer does this as of the
2511         2010-06-28 commit.  Also, don't try to invoke diff_archive on a
2512         zero block.
2513         * tests/Makefile.am (TESTSUITE_AT): Add verify.at.
2514         * tests/testsuite.at: Include verify.at.
2515         * tests/verify.at: New file.
2516
2517 2010-11-08  Paul Eggert  <eggert@cs.ucla.edu>
2518
2519         Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/tar
2520
2521 2010-11-08  Jim Meyering  <meyering@redhat.com>
2522
2523         tests: avoid spurious failure when VERSION_CONTROL envvar is set
2524         * tests/backup01.at: Unset VERSION_CONTROL.  Otherwise,
2525         when set to e.g., 'always', it would cause this test to fail.
2526
2527 2010-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
2528
2529         Version 1.25
2530         * configure.ac: Version 1.25
2531         * NEWS: Describe the changes.
2532
2533 2010-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>
2534
2535         Run alternative decompression programs if the principal one is
2536         not available.
2537         Some compression programs are able to handle various compression
2538         formats
2539         (e.g. `gzip' can decompress files created by `compress', `xz'
2540         is able
2541         to handle lzma, etc.)  Tar tries to use such programs for
2542         decompression
2543         if the principal decompressor cannot be started.
2544         * src/buffer.c (compress_type): Swap ct_none and ct_tar.
2545         (archive_compression_type): New static variable.
2546         (zip_magic): Remove program and option fields.
2547         (zip_program): New structure and static.
2548         (compress_program): Remove macro.
2549         (find_zip_program): New static function.
2550         (first_decompress_program,next_decompress_program): New functions.
2551         (open_compressed_archive): Set archive_compression_type instead of
2552         use_compress_program_option.
2553         * src/common.h (first_decompress_program)
2554         (next_decompress_program): New functions.
2555         (WARN_DECOMPRESS_PROGRAM): New flag.
2556         (WARN_VERBOSE_WARNINGS): Include WARN_DECOMPRESS_PROGRAM.
2557         * src/warning.c (warning_args): Add "decompress-program".
2558         (warning_types): Add WARN_DECOMPRESS_PROGRAM.
2559         * src/system.c (run_decompress_program): New function.
2560         (sys_child_open_for_uncompress): Use run_decompress_program
2561         instead of calling execlp directly.
2562
2563 2010-11-02  Paul Eggert  <eggert@cs.ucla.edu>
2564
2565         tests: fix some issues with signals, timestamps, "test" typo
2566         * tests/extrac17.at: Add --warning=no-timestamp, to avoid
2567         bogus warning due to NFS clock skew.
2568         * tests/remfiles01.at: Discard diagnostics that some shells
2569         generate about broken pipes.
2570         * tests/sigpipe.at: Likewise.
2571         * tests/remfiles01.at: Fix typo: "test $EC" was written where
2572         "test $EC -ne 0" was intended.
2573
2574 2010-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>
2575
2576         Fix extraction of device nodes.
2577         * src/extract.c (extract_node): Do not mask out node type.
2578         The bug was introduced in commit ea964cce.
2579
2580 2010-10-28  Paul Eggert  <eggert@cs.ucla.edu>
2581
2582         tar: don't cross struct member boundaries with OLDGNU_MAGIC
2583         * src/create.c (write_gnu_long_link, start_header): Access
2584         header->buffer + offsetof (struct posix_header, magic), instead of
2585         header->header.magic, when reading or writing the OLDGNU_MAGIC
2586         pattern.  The code violates the C standard without this change,
2587         and GCC warns about this if fortify checking is enabled.  It's not
2588         a bug on traditional (i.e., non-debugging) platforms, but it does
2589         violate the C standard so it should be fixed.  Problem originally
2590         reported by John Emil Karlson in
2591         <http://lists.gnu.org/archive/html/bug-tar/2010-04/msg00023.html>.
2592         * src/list.c (decode_header): Likewise.
2593
2594         tests: port to sh variants that squirrel away file descriptors
2595         OpenBSD /bin/sh, and some other sh variants, squirrel away file
2596         descriptors before closing them.  For example, for "cat 3<&-" they
2597         first dup file descriptor 3 to a fd that is 10 or greater, then
2598         close 3 (because if "cat" had been a builtin command like ":" then
2599         they would have wanted to avoid the fork and restore the fd after
2600         ":" finished); and they treat ordinary (forking) commands the same
2601         as builtin commands.  This approach fails after "ulimit -n 10".
2602         Work around this deficiency by closing the file descriptors before
2603         invoking ulimit.  Problem reported by Christian Weisgerber in
2604         <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00041.html>;
2605         solution suggested by Jilles Tjoelker in
2606         <http://article.gmane.org/gmane.comp.shells.dash/415>.
2607         * tests/extrac11.at (scarce file descriptors): Close file
2608         descriptors before invoking ulimit -n.
2609
2610 2010-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>
2611
2612         Transform file names when updating and appending to archives.
2613         This complements 28e91b48.
2614         * src/common.h (transform_stat_info): New prototype.
2615         * src/list.c (transform_stat_info): Remove static qualifier.
2616         * src/update.c (update_archive): Call transform_stat_info.
2617         * tests/Makefile.am (TESTSUITE_AT): Add append03.at
2618         * tests/testsuite.at: Include append03.at
2619
2620 2010-10-27  Paul Eggert  <eggert@cs.ucla.edu>
2621
2622         tests: port to Solaris diff
2623         * tests/extrac13.at: Don't assume that "diff -c" outputs nothing
2624         when there are no differences.  This is not true on Solaris,
2625         where it outputs "No differences encountered".
2626
2627         tar: fix -x --overwrite bug (no --dereference, ! O_NOFOLLOW)
2628         This bug was discovered on Solaris 8.  On older hosts lacking
2629         O_NOFOLLOW, tar -x --overwrite (without --dereference) follows
2630         symbolic links, causing the "extract over symlinks" test to fail.
2631         * src/extract.c (open_output_file): If O_NOFOLLOW is needed but
2632         does not work, check for a symlink separately.
2633
2634         tar: don't use "((" in shell scripts
2635         * tests/extrac11.at: Replace "((" with "( (" in shell scripts, as
2636         "((" is not portable to the Korn shell, and POSIX 1003.1-2008 says
2637         that "((" is not portable.
2638
2639 2010-10-26  Sergey Poznyakoff  <gray@gnu.org.ua>
2640
2641         Make sure name matching occurs before name transformation.
2642         The commit 9c194c99 altered that order.
2643         * src/list.c (transform_stat_info): New function.  Split off from
2644         decode_header.
2645         (read_and): Call transform_stat_info right before do_something,
2646         and after deciding if we should proceed with this member name,
2647         so that name matching occurs before name transformation.
2648         * tests/extrac17.at: New file.
2649         * tests/Makefile.am (TESTSUITE_AT): Add extrac17.at
2650         * tests/testsuite.at: Include extrac17.at.
2651
2652 2010-10-26  Paul Eggert  <eggert@cs.ucla.edu>
2653
2654         tar: don't assume stdin is open when testing fd limits
2655         * tests/extrac11.at: Redirect stdin from /dev/null, in case
2656         the parent 'make' is running with stdin closed.
2657
2658 2010-10-26  Sergey Poznyakoff  <gray@gnu.org.ua>
2659
2660         Further fixes in bootstrap.
2661         * bootstrap: Restore the default for gnulib_path
2662         (symlink_to_dir): Re-apply 67cad07.
2663
2664 2010-10-26  Paul Eggert  <eggert@cs.ucla.edu>
2665
2666         tar: fix bug with -C and extracting directories
2667         Problem reported by Denis Excoffier in
2668         <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00034.html>.
2669         * src/extract.c (extract_dir): Use mkdirat, not mkdir.
2670         * tests/extrac16.at: New file, to test for this bug.
2671         * tests/Makefile.am (TESTSUITE_AT): Add it.
2672         * tests/testsuite.at: Include it.
2673         This file is a placeholder. It will be replaced with the actual
2674         ChangeLog
2675         by make dist.  Run make ChangeLog if you wish to create it
2676         earlier.
2677
2678 2010-10-25  Sergey Poznyakoff  <gray@gnu.org.ua>
2679
2680         Version 1.24
2681         * configure.ac, NEWS: Version 1.24
2682         * bootstrap: Restore tar-specific code lost during last
2683         sync from gnulib (241b72ffad).
2684         * src/misc.c (chdir_do): Remove unused automatic variable.
2685
2686 2010-10-16  Paul Eggert  <eggert@cs.ucla.edu>
2687
2688         tar: use more-accurate diagnostic when intermediate mkdir fails
2689         Without this change, if tar tried to extract a file A/B/C, noticed
2690         that A/B didn't exist, attempted to mkdir A/B, and the mkdir
2691         failed, it did not diagnose the mkdir failure, but simply reported
2692         the failure to open A/B/C.  This sometimes led to confusion
2693         because it wasn't clear what tar was trying to do, in particular
2694         that tar tried to mkdir A/B.  With this patch, tar issues two
2695         diagnostics in this case: one for A/B and the other for A/B/C.
2696         Problem reported by Hauke Laging in
2697         <http://lists.gnu.org/archive/html/bug-tar/2010-10/msg00020.html>.
2698         * gnulib.modules: Remove faccessat.
2699         * src/extract.c (make_directories): New arg INTERDIR_MADE.
2700         Diagnose mkdir failure.  Return 0 on success, nonzero on failure,
2701         as opposed to nonzero iff some directory was created.  All callers
2702         changed.  Simplify the code when mkdir fails, by checking whether
2703         the desired file exists unless errno==EEXIST: this is more robust.
2704         * tests/extrac15.at: New test, to check this.
2705         * tests/Makefile.am (TESTSUITE_AT): Add it.
2706         * tests/testsuite.at: Include it.
2707
2708         tests: port to NFS file servers with clock skew
2709         Several of the tests assumed that a newly created file cannot
2710         have a time stamp dated in the future.  This assumption is not
2711         true when files are served by a remote host whose clock is
2712         slightly in advance of ours.  Fix the problems that I observed
2713         when running "make check" a couple of times on such a server.
2714         * tests/backup01.at: Use --warning=no-timestamp to suppress
2715         clock-skew warnings.
2716         * tests/chtype.at, tests/comprec.at, tests/exclude06.at:
2717         * tests/extrac01.at, tests/extrac03.at, tests/extrac05.at:
2718         * tests/extrac06.at, tests/extrac08.at, tests/extrac13.at:
2719         * tests/extrac14.at, tests/incr01.at, tests/incr03.at,
2720         tests/link01.at:
2721         * tests/multiv01.at, tests/multiv02.at, tests/multiv03.at:
2722         * tests/pipe.at, tests/rename02.at, tests/rename03.at:
2723         * tests/rename05.at, tests/same-order01.at, tests/same-order02.at:
2724         * tests/sparse01.at:
2725         Likewise.
2726
2727 2010-10-12  Paul Eggert  <eggert@cs.ucla.edu>
2728
2729         gnulib: sync from latest gnulib, notably bootstrap and
2730         parse-datetime
2731         * bootstrap: Sync from gnulib.
2732         * doc/.gitignore: Rename getdate.texi to parse-datetime.texi.
2733         * doc/Makefile.am (tar_TEXINFOS): Likewise.
2734         * doc/tar.texi (Top): Adjust to renaming of getdate to
2735         parse-datetime.
2736         * gnulib.modules: Likewise.  Also, remove ftruncate (now
2737         obsolete).
2738         And add inttostr (we missed this dependency).
2739         * src/tar.c: Include parse-datetime.h, not getdate.h.  All calls
2740         to get_date replaced with parse_datetime.
2741
2742 2010-09-24  Paul Eggert  <eggert@cs.ucla.edu>
2743
2744         tar: -x -C symlink fix
2745         * src/misc.c (chdir_do): Don't use O_NOFOLLOW when opening the
2746         argument to -C.  This is for consistency with "tar -c -C FOO", and
2747         matches the new documentation.
2748         * tests/extrac14.at: New file.
2749         * tests/Makefile.am (TESTSUITE_AT): Add it.
2750         * tests/testsuite.at: Include it.
2751
2752         tar: --dereference consistency
2753         This closes another race condition, that occurs when overwriting a
2754         symlink with a regular file.
2755         * NEWS (--dereference consistency): New section.
2756         * doc/tar.texi (Option Summary): Describe new --deference
2757         behavior.
2758         (dereference): Likewise.  Remove discussion that I didn't follow,
2759         even before --dereference was changed.
2760         * src/common.h (deref_stat, set_file_atime): Adjust signatures.
2761         * src/compare.c (diff_file, diff_multivol): Respect
2762         open_read_flags
2763         instead of rolling our own flags.  This implements the new
2764         behavior
2765         for --dereference.
2766         (diff_file, diff_dumpdir): Likewise, for fstatat_flags.
2767         * src/create.c: Adjust to set_file_atime signature change.
2768         * src/extract.c (mark_after_links, file_newer_p, extract_dir):
2769         Likewise.
2770         * src/incremen.c (try_purge_directory): Likewise.
2771         * src/misc.c (maybe_backup_file): Likewise.
2772         * src/extract.c (file_newer_p): New arg STP.  All callers changed.
2773         (maybe_recoverable): New arg REGULAR.  All callers changed.
2774         Handle the case of overwriting a symlink with a regular file,
2775         when --overwrite is specified but --dereference is not.
2776         (open_output_file): Add O_CLOEXEC, O_NOCTTY, O_NONBLOCK for
2777         consistency with file creation.  Add O_NOFOLLOW if
2778         overwriting_old_files && ! dereference_option.
2779         * src/incremen.c (update_parent_directory): Use fstat, not
2780         fstatat;
2781         there's less to go wrong.
2782         * src/misc.c (deref_stat): Remove DEREF arg.  All callers changed.
2783         Instead, use fstatat_flags.
2784         (set_file_atime): Remove ATFLAG arg.  All callers changed.
2785         Instead, use fstatat_flags.
2786         * src/names.c, src/update.c: Adjust to deref_stat signature
2787         change.
2788         * src/tar.c (get_date_or_file): Use stat, not deref_stat, as this
2789         is not a file to be archived.
2790         * tests/Makefile.am (TESTSUITE_AT): Add extrac13.at.
2791         * tests/extrac13.at: New file.
2792         * tests/testsuite.at: Include it.
2793
2794 2010-09-20  Paul Eggert  <eggert@cs.ucla.edu>
2795
2796         tar: do not crash with --listed-incremental
2797         Problem reported by Frantisek Hanzlik in
2798         <https://bugzilla.redhat.com/635318> via Kamil Dudka in
2799         <http://lists.gnu.org/archive/html/bug-tar/2010-09/msg00066.html>.
2800         I don't understand this code either, but Sergey can take a look at
2801         this patch, and perhaps install a better one, when he has
2802         the time.
2803         * src/incremen.c (append_incremental_renames): Don't actually
2804         append
2805         anything to DIR if DIR is null.
2806
2807 2010-09-19  Paul Eggert  <eggert@cs.ucla.edu>
2808
2809         tar: prefer openat-style functions
2810         This change replaces traditional functions like 'open' with the
2811         POSIX.1-2008 functions like 'openat'.  Mostly this is an internal
2812         refactoring change, in preparation for further changes to close
2813         some races.
2814         * gnulib.modules: Add faccessat, linkat, mkfifoat, renameat,
2815         symlinkat.
2816         Remove save-cwd.
2817         * src/Makefile.am (tar_LDADD): Add $(LIB_EACCESS).
2818         * tests/Makefile.am (LDADD): Likewise.
2819         * src/common.h (chdir_fd): New extern var.
2820         * src/compare.c (diff_file, diff_multivol): Use openat instead
2821         of open.
2822         * src/create.c (create_archive, restore_parent_fd): Likewise.
2823         * src/extract.c (create_placeholder_file): Likewise.
2824         * src/names.c (collect_and_sort_names): Likewise.
2825         * src/update.c (append_file): Likewise.
2826         * src/compare.c (diff_symlink): Use readlinkat instead of
2827         readlink.
2828         * src/compare.c (diff_file): Use chdir_fd instead of AT_FDCWD.
2829         * src/create.c (subfile_open, dump_file0): Likewise.
2830         * src/extract.c (fd_chmod, fd_chown, fd_stat, set_stat):
2831         (repair_delayed_set_stat, apply_nonancestor_delayed_set_stat):
2832         Likewise.
2833         * src/extract.c (mark_after_links, file_newer_p, extract_dir):
2834         (extract_link, apply_delayed_links):
2835         Use fstatat rather than stat or lstat.
2836         * src/misc.c (maybe_backup_file, deref_stat): Likewise.
2837         * src/extract.c (make_directories): Use mkdirat rather than mkdir.
2838         Use faccessat rather than access.  This fixes a minor permissions
2839         bug when tar is running setuid (who would want to do that?!).
2840         (open_output_file): Use openat rather than open.
2841         In the process, this removes support for Masscomp's O_CTG files,
2842         which aren't compatible with openat's signature.  Masscomp!  Wow!
2843         That's a blast from the past.  As far as I know, that operating
2844         system hasn't been supported for more than 20 years.
2845         (extract_link, apply_delayed_links):
2846         Use linkat rather than link.
2847         (extract_symlink, apply_delayed_links):
2848         Use symlinkat rather than symlink.
2849         (extract_node): Use mknodat rather than mknod.
2850         (extract_fifo): Use mkfifoat rather than mkfifo.
2851         (apply_delayed_links): Use unlinkat rather than unlink or rmdir.
2852         * src/misc.c (safer_rmdir, remove_any_file): Likewise.
2853         * src/unlink.c (flush_deferred_unlinks): Likewise.
2854         * src/extract.c (rename_directory): Use renameat rather than
2855         rename.
2856         * src/misc.c (maybe_backup_file, undo_last_backup): Likewise.
2857         * src/misc.c: Don't include <save-cwd.h>; no longer needed now
2858         that we're using openat etc.
2859         (struct wd): Add member fd.  Remove members err and fd.  All uses
2860         changed.
2861         (CHDIR_CACHE_SIZE): New constant.
2862         (wdcache, wdcache_count, chdir_fd): New vars.
2863         (chdir_do): Use openat rather than save_cwd.  Keep the cache up
2864         to date.  This code won't scale well, but is good enough for now.
2865         * src/update.c (update_archive): Use openat + fdopendir +
2866         streamsavedir rather than savedir.
2867         This file is a placeholder. It will be replaced with the actual
2868         ChangeLog
2869         by make dist.  Run make ChangeLog if you wish to create it
2870         earlier.
2871
2872 2010-09-18  Paul Eggert  <eggert@cs.ucla.edu>
2873
2874         tar: add utimens.h includes
2875         * src/extract.c: Include <utimens.h>, needed for fdutimens
2876         prototype.
2877         * src/misc.c: Likewise.
2878
2879         tar: switch to gnulib fdutimensat module
2880         * gnulib.modules: Add fdutimensat.
2881         * src/common.h (fd_utimensat): Remove decl.
2882         * src/extract.c (set_stat): Call fdutimensat, not fd_utimensat.
2883         * src/misc.c (set_file_atime): Likewise.
2884         (fd_utimensat): Remove.
2885
2886 2010-09-17  Paul Eggert  <eggert@cs.ucla.edu>
2887
2888         tar: extract permissions for . last
2889         * src/common.h (must_be_dot_or_slash): New decl.
2890         * src/extract.c (mark_after_links): New function, taking code
2891         that used to be in create_placeholder_file.
2892         (create_placeholder_file): Use it.
2893         (delay_set_stat): Always delay setting status for . and /.
2894         * src/misc.c (must_be_dot_or_slash): Now extern.
2895         * tests/extrac12.at: New file.
2896         * tests/Makefile.am (TESTSUITE_AT): Add it.
2897         * tests/testsuite.at: Likewise.
2898
2899         tar: don't check for getdtablesize; use AC_CHECK_FUNCS_ONCE
2900         * configure.ac: Don't check for getdtablesize; no longer needed.
2901         Use AC_CHECK_FUNCS_ONCE rather than AC_CHECK_FUNCS, for
2902         efficiency.
2903
2904         tar: extract symlink attributes, close some symlink-related races
2905         * NEWS: Describe symlink-extraction improvements.
2906         * src/extract.c (enum permstatus): Remove.
2907         (fchmod, fchown): Define dummy replacement macros if the system
2908         does not supply them.
2909         (implemented): New function.
2910         (struct delayed_set_stat): Remove members invert_permissions,
2911         permstatus.  They were too confusing, and tried to do too much
2912         in too-little space.  Instead, add members current_mode,
2913         current_mode_mask, interdir, atflag.  All users changed.
2914         (struct delayed_link): Add members mode, atime, mtime, to support
2915         platforms such as BSD where symlinks have these attributes.
2916         All users changed.
2917         (fd_chmod): Renamed from fdchmod.  New argument atflag.  Check for
2918         operation not supported at run-time, not at configure-time.  Put
2919         fd argument first.  All callers changed.
2920         (fd_chown): Likewise, renaming from fdchown.
2921         (fd_stat): Likewise, renaming from fdstat.
2922         (set_mode): Remove args stat_info, cur_info, invert_permissions,
2923         permstatus.  Add args mode, mode_mask, current_mode,
2924         current_mode_mask,
2925         atflag.  All callers changed.  Close some races.  Use an easier-to
2926         understand method for computing permissions.  Work around POSIX
2927         incompatibility in Linux fchmodat.  Support extraction of symlink
2928         modes, if the OS allows it.
2929         (set_stat): Remove args cur_info, invert_permissions, permstatus.
2930         Add args current_mode, current_mode_mask, interdir, atflag.
2931         All callers changed.  Close some races.  Support extraction of
2932         attributes on symlinks, if the OS allows it.
2933         (delay_set_stat): Remove args invert_permissions, permstatus.
2934         Add args current_mode, current_mode_mask, mode, atflag.
2935         The ST arg can be null now, indicating that it's an intermediate
2936         directory.  All callers changed.
2937         (repair_delayed_set_stat, apply_nonancestor_delayed_set_stat):
2938         Close some races.
2939         (extract_dir): Also be paranoid if only --same-permissions, due
2940         to semantics of setgid and setuid directories on some hosts.
2941         This closes a race on those hosts.  Simplify calculation of
2942         delay_set_stat arguments; the old code was truly strange and
2943         probably wrong in some border cases.
2944         (extract_dir, extract_file, extract_node, extract_fifo): Don't
2945         rely on
2946         unspecified behavior in mode arg of open, mknod, etc.  Instead,
2947         mask out those bits when creating the file, and add them later via
2948         fchmod or chmodat.
2949         (open_output_file): file_name is now const.  Add arg current_mode,
2950         current_mode_mask.  All callers changed.  When overwriting
2951         old files,
2952         refuse to overwrite something that is not a regular file, since
2953         we're extracting a regular file.
2954         (extract_file): Remove the FIXME comment.  Whatever the protection
2955         issues were, they should be fixed now.  As a result of all
2956         the other
2957         API changes, we now use fchmod etc. rather than chmod etc.,
2958         closing
2959         some races.
2960         (create_placeholder_file, apply_delayed_links): Record desired
2961         mode and times for symlinks, for OSes that support that.
2962
2963 2010-09-16  Paul Eggert  <eggert@cs.ucla.edu>
2964
2965         tar: tar -x without --incremental no longer sets atime again
2966         * src/extract.c (set_stat): Use UTIME_OMIT rather than UTIME_NOW.
2967         The UTIME_NOW was there only to emulate the previous behavior of
2968         using the current time, and the previous behavior was there only
2969         because before we started assuming POSIX.1-2008 there was no
2970         portable way to get the effect of UTIME_NOW.
2971
2972         tar: another --atime-preserve race fix
2973         * src/common.h (set_file_atime): Add parentfd arg.
2974         * src/compare.c (diff_file): Use it.
2975         * src/create.c (dump_file0): Likewise.  This closes yet another
2976         race condition with symbolic links.
2977         * src/misc.c (set_file_atime): Add parentfd arg.
2978
2979         tar: --atime-preserve fixes for races etc.
2980         This patch fixes a race condition in the --atime-preserve=replace
2981         option, which might cause tar to improperly follow a symbolic
2982         link.
2983         It also drops the use of the _FIOSATIME ioctl of Solaris 2.x
2984         and later, which loses resolution on time stamps.  Modern Solaris
2985         systems support full-resolution time stamps in the kernel, and
2986         it's not worth the hassle of testing this call, useful only in
2987         no-longer-supported Solaris variants.
2988         Also, it undoes a change I recently introduced to the --compare
2989         option, which caused it to not follow symbolic links unless the
2990         --dereference option was also used.  Quite possibly this change is
2991         a good idea, but the old behavior was documented and the change
2992         should not have been installed casually.
2993         * configure.ac: Don't check for stropts.h and sys/filio.h.
2994         * gnulib.modules: Add futimens, utimensat.  Remove futimens.
2995         * src/common.h (fd_utimensat): New decl.
2996         * src/compare.c (diff_file, diff_multivol):
2997         Don't use open_read_flags: those are for --create only.
2998         * src/create.c (dump_file0): Adjust to set_file_atime changes.
2999         Pass fstatat_flags to set_file_atime, so that symbolic links are
3000         not followed inadvertently.
3001         * src/extract.c: Don't include utimens.h.
3002         (set_stat): Use fd_utimensat ant UTIME_NOW rather than fdutimens.
3003         * src/misc.c: Don't include utimens.h, stropts.h, sys/filio.h.
3004         (fd_utimensat): New function.
3005         (set_file_atime): Use it.  New arg atflag, controlling symlink
3006         handling.  All callers changed.
3007
3008 2010-09-14  Paul Eggert  <eggert@cs.ucla.edu>
3009
3010         * configure.ac: tar: close some race conditions when extracting
3011         * configure.ac: Check for fchmod and fchown.  Don't check
3012         for utimes.
3013         * src/extract.c (fdchmod, fdchown, fdstat): New functions.
3014         (set_mode, set_stat): New arg FD.  All callers changed.
3015         This avoids some race conditions between closing a regular file
3016         and setting its metadata, and it's a bit faster.
3017
3018 2010-09-13  Paul Eggert  <eggert@cs.ucla.edu>
3019
3020         tar: don't worry about fdopendir closing its argument
3021         * NEWS: Don't mention dirfd; no longer needed.
3022         * gnulib.modules: Remove dirfd.
3023         * src/create.c (get_directory_entries): Remove the code dealing
3024         with dirfd failures, as the new fdopendir replacement doesn't
3025         close its argument so we don't need to call dirfd.  See
3026         <http://lists.gnu.org/archive/html/bug-gnulib/2010-09/msg00208.html>
3027         and gnulib commit 970c9038e4cca46e1b037ae0a6d574dfae6a7327.
3028
3029         * NEWS: Fix wording typo in previous change.
3030         Reported by Jim Meyering.
3031
3032         tar: live within system-supplied limits on file descriptors
3033         * NEWS: Note the change.  Mention dirfd and fdopendir.
3034         * gnulib.modules: Add dirfd and fdopendir.  The code was already
3035         using fdopendir; dirfd is a new need.
3036         * src/common.h (open_searchdir_flags, get_directory_entries):
3037         (subfile_open, restore_parent_fd, tar_stat_close): New decls.
3038         (check_exclusion_tags): Adjust signature to match code change.
3039         * src/create.c (IMPOSTOR_ERRNO): New constant.
3040         (check_exclusion_tags): First arg is now a struct tar_stat_info
3041         const *, not an fd.  All callers changed.
3042         (dump_regular_file, dump_file0): A zero fd represents an unused
3043         slot, so play it safe if the fd member is zero here.  A negative
3044         fd represents the negation of an errno value, so play it safe and
3045         do not assign -1 to fd merely because an open fails.
3046         (open_failure_recover, get_directory_entries, restore_parent_fd):
3047         (subfile_open): New functions.  These help to recover from file
3048         descriptor exhaustion.
3049         (dump_dir, dump_file0): Use them.
3050         (dump_file0): Use tar_stat_close instead of rolling our own close.
3051         * src/incremen.c (scan_directory): Use get_directory_entries,
3052         subfile_open, etc., to recover from file descriptor exhaustion.
3053         * src/names.c (add_hierarchy_to_namelist): Likewise.
3054         (collect_and_sort_names): A negative fd represents the negation
3055         of an errno value, so play it safe and do not assign -1 to fd.
3056         * src/tar.c (decode_options): Set open_searchdir_flags.
3057         Add O_CLOEXEC to all the open flags.
3058         (tar_stat_close): New function, which knows how to deal with
3059         new convention for directory streams and file descriptors.
3060         Diagnose 'close' failures.
3061         (tar_stat_destroy): Use it.
3062         * src/tar.h (struct tar_stat_info): New member dirstream.
3063         fd now has the negative of an errno value, not merely -1, if
3064         the file could not be opened, so that failures to reopen
3065         directories
3066         are better-diagnosed later.
3067         * tests/Makefile.am (TESTSUITE_AT): Add extrac11.at.
3068         * tests/testsuite.at: Likewise.
3069         * tests/extrac11.at: New file.
3070
3071 2010-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3072
3073         tar: improve documentation of reliability and security issues
3074         * doc/tar.texi (Reliability and security, Reliability):
3075         (Permissions problems, Data corruption and repair, Race
3076         conditions):
3077         (Security, Privacy, Integrity, Live untrusted data):
3078         (Security rules of thumb): New nodes.
3079
3080 2010-09-06  Paul Eggert  <eggert@cs.ucla.edu>
3081
3082         tar: more reliable directory traversal when creating archives
3083         * NEWS: Document this.
3084         * gnulib.modules: Add openat, readlinkat.
3085         * src/common.h (open_read_flags, fstatat_flags): New global
3086         variables.
3087         (cachedir_file_p, dump_file, check_exclusion_tags,
3088         scan_directory):
3089         Adjust to new signatures, described below.
3090         (name_fill_directory): Remove.
3091         * src/compare.c (diff_file, diff_multivol): Use open_read_flags.
3092         * src/create.c (struct exclusion_tag): Exclusion predicates
3093         now take
3094         a file descriptor, not a file name.
3095         (add_exclusion_tag): Likewise.  All uses changed.
3096         (cachedir_file_p): Likewise.
3097         (check_exclusion_tags): The directory is now a file descriptor,
3098         not a file name.  All uses changed.  Use openat for better
3099         traversal.
3100         (file_dumpable_p): Arg is now a struct stat, not a struct
3101         tar_stat_info.  All uses changed.  Check the arg's file types too.
3102         (dump_dir0, dump_dir, dump_file0, dump_file): Omit top_level and
3103         parent_device args, since st->parent tells us that now.  All uses
3104         changed.
3105         (dump_dir): Likewise.  Also, omit fd arg for similar reasons.
3106         Apply fdsavedir to a dup of the file descriptor, since we need a
3107         file descriptor for openat etc. as well, and fdsavedir (perhaps
3108         unwisely) consumes its file descriptor when successful.
3109         Do not consume st->fd when successful; this simplifies the caller.
3110         (create_archive): Allocate a file descriptor when retraversing
3111         a directory, during incremental dumps.
3112         (dump_file0): Use fstatat, openat, and readlinkat for better
3113         traversal.
3114         When opening a file, use the result of fstat on the file
3115         descriptor
3116         rather than the fstatat on the directory entry, to avoid some race
3117         conditions.  No need to reopen the directory since we now
3118         no longer
3119         close it.  Change "did we open the file?" test from 0 <= fd to
3120         0 < fd since fd == 0 now represents uninitialized.
3121         (dump_file): Now accepts struct tar_stat_info describing parent,
3122         not parent_device.  Also, accept basename and fullname of entry.
3123         All uses changed.
3124         * src/incremen.c (update_parent_directory): Accept struct
3125         tar_stat_info for parent, not name.  All callers changed.
3126         Use fstatat for safer directory traversal.
3127         (procdir): Accept struct tar_stat_info, not struct stat and
3128         dev_t, for info about directory.  All callers changed.
3129         (scan_directory): Accept struct tar_stat_info, not name,
3130         device, and cmdline, for info about directory.  All callers
3131         changed.  Do not consume the file descriptor, since caller
3132         might need it.  Use fstatat and openat for safer directory
3133         traversal; also, use fstat after opening to double-check.
3134         (name_fill_directory): Remove.
3135         * src/names.c (add_hierarchy_to_namelist): Accept struct
3136         tar_stat_info instead of device and cmdline.  All callers changed.
3137         When descending into a subdirectory, use openat and fstat for
3138         safer directory traversal.
3139         (collect_and_sort_names): Use open and fstat for safer directory
3140         traversal.  Set up struct tar_stat_info for callee's new API.
3141         * src/tar.c (decode_options): Initialize open_read_flags
3142         and fstatat_flags.
3143         (tar_stat_destroy): Close st->fd if it is positive (not zero!).
3144         * src/tar.h (struct tar_stat_info): New members parent, fd.
3145         * src/update.c (update_archive): Adjust to dump_file's API change.
3146         * tests/filerem02.at: Ignore stderr since its contents now depend
3147         on the file system implementation.
3148
3149 2010-09-05  Paul Eggert  <eggert@cs.ucla.edu>
3150
3151         tar: remove lint discovered by Sun C compiler
3152         * src/common.h (WARN_ALL): Don't mask with 0xffffffff; on a 32-bit
3153         host, 0xffffffff is of type 'unsigned int', which makes WARN_ALL
3154         an unsigned int value that is too large to fit into an int, and
3155         the C standard says that this has undefined behavior.  The mask is
3156         not needed, so omit it.
3157
3158 2010-09-04  Paul Eggert  <eggert@cs.ucla.edu>
3159
3160         tar: restore macros that are used in some cases
3161         * src/tar.c (LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
3162         Restore these macros, undoing the previous change to this file.
3163         The macros are used after all, in some cases.  Sorry about that.
3164
3165 2010-09-03  Paul Eggert  <eggert@cs.ucla.edu>
3166
3167         tar: remove unused macros
3168         * src/create.c (UINTMAX_TO_CHARS): Remove; no longer used.
3169         * src/tar.c (LOW_DENSITY_NUM, MID_DENSITY_NUM, HIGH_DENSITY_NUM):
3170         Likewise.
3171         * src/incremen.c (DIR_IS_NEW): Comment out; not used.
3172         Mark this with a FIXME, since it looks like it should be used.
3173
3174 2010-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>
3175
3176         Fix --remove-files in update/append mode.
3177         * src/update.c (update_archive): Call finish_deferred_unlinks when
3178         done.
3179
3180 2010-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3181
3182         tar: avoid assumptions about root access and chmod -w in test
3183         cases
3184         * tests/extrac07.at, tests/extrac09.at, tests/listed03.at: Use
3185         AT_UNPRIVILEGED_PREREQ, since this test requires non-root
3186         privileges.
3187         * tests/extrac07.at: Don't use "chmod -w", as POSIX says it's not
3188         portable to start a chmod permissions-list with "-" as it may be
3189         confused with an option.  Use "chmod a-w" instead.
3190
3191         tar: fix bug with -C and delayed setting of metadata
3192         * src/common.h (chdir_current): New decl.
3193         * src/extract.c (struct delayed_set_stat, struct delayed_link):
3194         New member change_dir.
3195         (delay_set_stat, create_placeholder_file): Set it.
3196         (apply_nonancestor_delayed_set_stat, apply_delayed_links): Use it.
3197         (extract_link): Check that the links are all relative to the same
3198         directory.
3199         (extract_archive): Restore the current directory after
3200         apply_nonancestor_delayed_set_stat has possibly changed it.
3201         * src/misc.c (chdir_current): New external var; this used to
3202         be the private static variable 'previous' inside chdir_dir.
3203         All uses changed.
3204         * tests/Makefile.am (TESTSUITE_AT): New test extrac10.at.
3205         * tests/extrac10.at: New file.
3206         * tests/testsuite.at: Include it.
3207
3208 2010-08-25  Sergey Poznyakoff  <gray@gnu.org.ua>
3209
3210         Don't apply file transformations to volume names.
3211         * src/list.c (decode_header): Don't apply file transformations
3212         to volume names.
3213         * tests/xform01.at: New testcase.
3214         * tests/xform-h.at (xform): Rename macro to xformtest. Use
3215         pushdef/popdef.
3216         * tests/Makefile.am, tests/testsuite.at: Add xform01.at
3217
3218 2010-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3219
3220         tar: optimize -c --sparse when file is entirely sparse
3221         * src/sparse.c (sparse_scan_file): If the file is entirely sparse,
3222         that is, if ST_NBLOCKS is zero, don't bother scanning for nonzero
3223         blocks.  Idea by Kit Westneat, communicated by Bernd Schubert in
3224         <http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00038.html>.
3225         Also, omit unnecessary lseek at start of file.
3226
3227         tar: don't assume size of a sparse file chunk fits in size_t
3228         * src/tar.h (struct sp_array): Change numbytes from size_t
3229         to off_t.
3230         All uses changed.
3231         * scripts/xsparse.c (struct sp_array): Likewise.
3232         Include <stdint.h>, for SIZE_MAX.
3233         (expand_sparse): Don't try to allocate a buffer bigger than
3234         SIZE_MAX bytes.
3235         * src/common.h (SIZE_TO_CHARS, size_to_chars, SIZE_FROM_HEADER):
3236         (size_from_header): Remove decls.
3237         * src/create.c (size_to_chars): Remove.
3238         * src/list.c (size_from_header): Remove.
3239         * src/sparse.c (sparse_extract_region, check_data_region):
3240         (oldgnu_add_sparse, oldgnu_store_sparse_info, pax_decode_header):
3241         Don't assume chunk sizes fit in size_t.
3242         (oldgnu_add_sparse): Check for off_t overflow.
3243         * src/xheader.c (sparse_numbytes_decoder, sparse_map_decoder):
3244         Likewise.
3245
3246         tar: use ctime, not mtime, when checking placeholders
3247         * src/extract.c (struct delayed_link): Rename member mtime
3248         to ctime.
3249         All uses changed to use ctime rather than mtime.
3250
3251 2010-08-24  Paul Eggert  <eggert@cs.ucla.edu>
3252
3253         tar: add comment to link04.at test
3254         * tests/link04.at: Add explanatory comment at head.
3255
3256         tar: fix 1.23 Solaris regression related to PRIV_SYS_LINKDIR
3257         The idea was suggested by Petr Sumbera in the thread starting
3258         here:
3259         http://lists.gnu.org/archive/html/bug-tar/2010-08/msg00000.html
3260         * src/extract.c (set_mode): Save the errno of the chmod that
3261         failed, for the benefit of chmod_error_details.  Do not bother
3262         retrying chmod unless the mode suggests setuid is the issue.
3263         (extract_archive): Remove redundant call to
3264         priv_set_remove_linkdir.
3265         * src/system.c: Include priv-set.h.
3266         (sys_spawn_shell, sys_child_open_for_compress):
3267         (sys_child_open_for_uncompress, sys_exec_command):
3268         (sys_exec_info_script, sys_exec_checkpoint_script):
3269         Invoke priv_set_restore_linkdir before execv or execlp, so that
3270         the subprocess has the same privileges that tar originally did.
3271
3272         tar: handle files that occur multiple times but have link count 1
3273         This patch was inspired by the following patch that addressed a
3274         similar problem in GNU coreutils du:
3275         http://git.savannah.gnu.org/gitweb/?p=coreutils.git;h=efe53cc72b599979ea292754ecfe8abf7c839d22
3276         * src/common.h (name_count): New decl.
3277         * src/create.c (trivial_link_count): New static var.
3278         (create_archive): Initialize it.
3279         (dump_hard_link, file_count_links): Use it, so that files with
3280         link count 1 are handled correctly when they are found multiple
3281         times.
3282         * src/names.c (allocated_entries): Renamed from allocated_names,
3283         since the identifier's name was misleading.  All uses changed.
3284         (entries): Renamed from names.  All uses changed.
3285         (scanned): Renamed from name_index.  All uses changed.
3286         (name_count): New var.
3287         (name_add_name): Increment it.
3288         * tests/link04.at: New file.
3289         * tests/testsuite.at: Add it.
3290         * tests/Makefile.am (TESTSUITE_AT): Likewise.
3291
3292 2010-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3293
3294         tar: use nlink_t for link counts
3295         * src/create.c (struct link): nlink is now of type nlink_t,
3296         not size_t.
3297
3298         tar: don't export names that aren't used elsewhere
3299         * src/common.h (file_dumpable_p, gid_to_chars, major_to_chars):
3300         (minor_to_chars, mode_to_chars, uid_to_chars, uintmax_to_chars):
3301         (string_to_chars, dumpdir_creat0, dumpdir_create, dumpdir_free):
3302         (dumpdir_locate, dumpdir_next, dumpdir_first, gid_from_header):
3303         (major_from_header, minor_from_header, mode_from_header):
3304         (time_from_header, uid_from_header, quote_copy_string,
3305         request_stdin):
3306         (xheader_init, transform_header_name):
3307         Remove declarations; these are no longer exported from their
3308         modules.
3309         (GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS):
3310         (UID_TO_CHARS, UINTMAX_TO_CHARS, UNAME_TO_CHARS, GNAME_TO_CHARS):
3311         Move to src/create.c, since no other module uses these.
3312         (GID_FROM_HEADER, MAJOR_FROM_HEADER, MINOR_FROM_HEADER):
3313         (MODE_FROM_HEADER, TIME_FROM_HEADER, UID_FROM_HEADER):
3314         Move to src/extract.c, since no other module uses these.
3315         (dumpdir_t, dumpdir_iter_t): Remove; no longer used.
3316         * src/create.c (gid_to_chars, major_to_chars, minor_to_chars):
3317         (mode_to_chars, uid_to_chars, uintmax_to_chars, string_to_chars):
3318         (file_dumpable_p): Now static.
3319         * src/incremen.c (dumpdir_create0, dumpdir_create, dumpdir_free):
3320         (dumpdir_locate, dumpdir_next, dumpdir_first): Now static.
3321         (scan_directory, write_directory_file_entry):
3322         Use struct dumpdir_iter * rather than dumpdir_iter_t.
3323         * src/list.c (gid_from_header, major_from_header,
3324         minor_from_header):
3325         (mode_from_header, time_from_header, uid_from_header):
3326         (transform_member_name): Now static.
3327         * src/misc.c (quote_copy_string): #if 0 out, as it's not used
3328         anywhere.
3329         * src/system.c (wait_for_grandchild): Now static.
3330         * src/tar.c (request_stdin): Now static.
3331         * src/xheader.c (xheader_init): Now static.
3332
3333         tar: fix misspelled identifier "set_comression_program_by_suffix"
3334         * src/suffix.c (set_compression_program_by_suffix): Renamed from
3335         set_comression_program_by_suffix.
3336         * src/buffer.c, src/common.h, src/tar.c: All uses changed.
3337
3338 2010-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3339
3340         tar: change interdir_made from int to bool
3341         * src/extract.c (maybe_recoverable, create_placeholder_file):
3342         Change interdir_made from int * to bool *, since the flag has just
3343         two values 0 and 1.  All uses changed.  This does not affect tar's
3344         behavior.
3345
3346         tar: remove trailing white space from source files
3347         * ChangeLog.1, ChangeLog.CVS, Makefile.am, NEWS, README:
3348         * README-hacking, directory, doc/Makefile.am, doc/dumpdir.texi:
3349         * doc/gendocs_template, doc/intern.texi, doc/mastermenu.el:
3350         * doc/snapshot.texi, doc/sparse.texi, doc/tar-snapshot-edit.texi:
3351         * doc/value.texi, lib/Makefile.am, scripts/backup-specs:
3352         * scripts/dump-remind.in, scripts/tar-snapshot-edit,
3353         scripts/tarcat:
3354         * scripts/xsparse.c, src/arith.h, src/buffer.c, src/compare.c:
3355         * src/create.c, src/delete.c, src/exit.c, src/suffix.c, src/tar.c:
3356         * src/tar.h, src/update.c, src/warning.c, src/xheader.c:
3357         * tests/append01.at, tests/append02.at, tests/atlocal.in:
3358         * tests/delete03.at, tests/exclude.at, tests/exclude06.at:
3359         * tests/extrac04.at, tests/extrac05.at, tests/extrac06.at:
3360         * tests/extrac07.at, tests/filerem01.at, tests/filerem02.at:
3361         * tests/incr01.at, tests/incr02.at, tests/incr03.at,
3362         tests/incr06.at:
3363         * tests/label02.at, tests/label03.at, tests/label04.at:
3364         * tests/label05.at, tests/link02.at, tests/link03.at:
3365         * tests/listed01.at, tests/listed02.at, tests/long01.at:
3366         * tests/longv7.at, tests/multiv01.at, tests/multiv02.at:
3367         * tests/multiv03.at, tests/multiv05.at, tests/multiv06.at:
3368         * tests/multiv07.at, tests/multiv08.at, tests/options.at:
3369         * tests/options02.at, tests/remfiles03.at, tests/rename01.at:
3370         * tests/rename02.at, tests/rename03.at, tests/rename04.at:
3371         * tests/rename05.at, tests/same-order01.at, tests/same-order02.at:
3372         * tests/shortfile.at, tests/shortupd.at, tests/sparse01.at:
3373         * tests/sparse02.at, tests/sparsemv.at, tests/sparsemvp.at:
3374         * tests/star/README, tests/star/gtarfail2.at:
3375         * tests/star/multi-fail.at:
3376         * tests/star/pax-big-10g.at, tests/star/quicktest.sh:
3377         * tests/star/ustar-big-2g.at, tests/star/ustar-big-8g.at:
3378         * tests/update01.at, tests/update02.at, tests/volsize.at:
3379         * tests/volume.at:
3380         Remove trailing spaces and tabs from lines, and remove
3381         trailing empty lines from files.  This makes it a bit easier
3382         to share code among coreutils and other projects that do this.
3383
3384 2010-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3385
3386         tar: update licenses to latest versions from www.gnu.org
3387         * COPYING: Update to latest version; this is just minor
3388         formatting.
3389         * doc/fdl.texi: Update from GFDL 1.2 to 1.3.
3390         * doc/tar.texi: Adjust to new format of fdl.texi.  Omit trailing
3391         white space.
3392
3393 2010-07-18  Paul Eggert  <eggert@cs.ucla.edu>
3394
3395         * src/misc.c (struct wd): Fix comment to match code.
3396
3397 2010-07-18  Paul R. Eggert  <eggert@cs.ucla.edu>
3398
3399         tar: no need to report getcwd error if never using the result
3400         * src/misc.c (struct wd): Rename 'saved' to 'err', with new
3401         semantics.
3402         (chdir_arg, chdir_do): Adjust to new semantics.  Do not report an
3403         error merely because save_cwd fails; report an error only if
3404         save_cwd's result is needed later.
3405         * tests/extrac09.at: New file, to test for bug that was fixed.
3406         * tests/testsuite.at: Include it.
3407         * tests/Makefile.am (TESTSUITE_AT): Add it.
3408
3409         tar: go back to absolutifying filenames in normalize_filename
3410         for now
3411         * src/misc.c (normalize_filename): For now, go back to making
3412         filenames absolute, even though this causes 'tar' to fail when
3413         getcwd fails.  However, do not attempt to resolve ".." as this
3414         does not work with symlinks.  Also, do the right thing with
3415         leading file system prefixes and on hosts where // != /.
3416
3417 2010-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>
3418
3419         Allow for size suffixes in -L and --record-size options.
3420         * src/tar.c (TAR_SIZE_SUFFIXES): New define.
3421         (parse_opt): Allow for size suffixes in arguments to
3422         -L and --record-size options.
3423         * NEWS, doc/tar.texi: Update.
3424
3425 2010-07-15  Paul R. Eggert  <eggert@cs.ucla.edu>
3426
3427         tar: don't crash if getcwd fails
3428         * src/extract.c: Don't include xgetcwd.h.
3429         (extract_dir): stat "." rather than statting getcwd's output.
3430         * src/misc.c (normalize_filename_x): Rewrite so as not to resolve
3431         /../, which can't be done reliably in the presence of symlinks.
3432         Don't reject valid names such as ".".
3433         (normalize_filename): Don't make it absolute; that way, we don't
3434         have to invoke xgetcwd which might fail.  Don't bother to realloc
3435         at the end, since that uses time and now saves little space.
3436         (chdir_do): Don't crash if xgetcwd fails.
3437         * tests/Makefile.am (TESTSUITE_AT): Add listed03.at.
3438         * tests/listed03.at: New file.
3439         * tests/testsuite.at: Include listed03.at.
3440
3441 2010-07-11  Sergey Poznyakoff  <gray@gnu.org.ua>
3442
3443         Keep a detailed map of archive members stored in the record
3444         buffer.
3445         A separate map (bufmap) provides information for creating
3446         multi-volume continuation headers.
3447         * src/buffer.c (bufmap): New struct.
3448         (bufmap_head, bufmap_tail, inhibit_map): New variables.
3449         (mv_begin_write): New function.
3450         (mv_begin): Rename to mv_begin_read. Rewrite using mv_begin_write.
3451         All callers changed.
3452         (mv_total_size): Remove.
3453         (bufmap_locate, bufmap_free, bufmap_reset): New functions.
3454         (_flush_write): Update bufmap.
3455         (close_archive): Free bufmap.
3456         (add_chunk_header): Take a bufmap argument.
3457         (gnu_add_multi_volume_header): Likewise.
3458         (add_multi_volume_header): Likewise.
3459         (_gnu_flush_write): Rewrite using bufmap.
3460         (real_s_name, real_s_totsize)
3461         (real_s_sizeleft)
3462         (save_name, save_totsize, save_sizeleft): Removed. All
3463         uses updated.
3464         (mv_size_left): Update bufmap_head.
3465         (mv_end): Rewrite.
3466         (multi_volume_sync): Remove.
3467         * src/common.h (mv_begin_write): New prototype.
3468         (mv_begin): Rename to mv_begin_read.
3469         * src/create.c: Use mv_begin_write instead of mv_begin.
3470         Remove calls to mv_size_left and mv_end.
3471         * src/sparse.c: Likewise.
3472         * tests/multiv07.at: Close stdin.
3473         * tests/spmvp00.at: Update AT_KEYWORDS.
3474         * tests/spmvp10.at: Likewise.
3475         * tests/multiv08.at: New testcase.
3476         * tests/Makefile.am, tests/testsuite.at: Add multiv08.at.
3477
3478         Version 1.23.90
3479         * NEWS, configure.ac: Version 1.23.90
3480         * doc/tar.texi: Document the use of lbzip2.
3481
3482 2010-06-28  Sergey Poznyakoff  <gray@gnu.org.ua>
3483
3484         Fix exclusion of long file names when extracting from pax format
3485         archives.
3486         * src/list.c (read_and): Call decode_header before attempting
3487         name_match.
3488         (list_archive): Remove call to decode_header.
3489         * src/compare.c (diff_archive): Remove call to decode_header.
3490         * src/extract.c (extract_archive): Likewise.
3491         * test/exclude06.at: New test case.
3492         * tests/testsuite.at: Include exclude06.at.
3493         * tests/Makefile.am (TESTSUITE_AT): Add exclude06.at.
3494
3495         Minor fix.
3496         * src/buffer.c (magic): Split the character constant to help
3497         cc recognize character boundaries (7 is a valid hex character).
3498
3499 2010-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>
3500
3501         Minor fix.
3502         * src/buffer.c (magic): Fix xz magic.
3503
3504 2010-06-16  Paul Eggert  <eggert@cs.ucla.edu>
3505
3506         Remove some lint, found by gcc -W etc.
3507         * src/common.h (label_notfound): New decl.
3508         * src/buffer.c (set_volume_start_time, compress_type):
3509         (guess_seekable_archive, open_compressed_archive, init_buffer):
3510         (_flush_write, archive_is-dev, increase_volume_number):
3511         (change_tape_menu, try_new_volume, add_chunk_header):
3512         (multi_volume_sync):
3513         Declare as 'static' if it's not exported.
3514         Use function prototype (void) rather than old-style ().
3515         * src/checkpoint.c (expand_checkpoint_string): Likewise.
3516         * src/incremen.c (dirlist_replace_prefix, makedumpdir,
3517         read_incr_db_2):
3518         Likewise.
3519         * src/list.c (print_volume_label): Likewise.
3520         * src/misc.c (normalize_filename_x): Likewise.
3521         * src/names.c (make_name, free_name, check_name_alloc,
3522         name_next_elt):
3523         Likewise.
3524         * src/tar.c (tar_list_quoting_style, add_exclude_array):
3525         (set_stat_signal): Likewise.
3526         * src/transform.c (new_transform,
3527         _single_transform_name_to_obstack):
3528         (_transform_name_to_obstack): Likewise.
3529         * src/unlink.c (dunlink_alloc): Likewise.
3530         * src/buffer.c (struct zip_magic): Use const when appropriate.
3531         * src/incremen.c (obstack_code_rename,
3532         write_directory_file_entry):
3533         Likewise.
3534         * src/sparse.c (COPY_STRING): Likewise.
3535         * src/system.c (dec_to_env, time_to_env, oct_to_env, str_to_env):
3536         (chr_to_env): Likewise.
3537         * src/tar.c (tar_list_quoting_style, set_stat_signal): Likewise.
3538         * src/extract.c (extract_node): Don't return garbage.
3539         * src/names.c: Remove old-style declarations of getgrnam etc.
3540         All modern systems declare these, and it's not worth the hassle
3541         of ignoring the warnings on modern systems for old-style decls.
3542
3543 2010-05-17  Sergey Poznyakoff  <gray@gnu.org.ua>
3544
3545         Bugfix.
3546         * src/incremen.c (make_directory): Retain the slash if it is the
3547         only character in a filename.
3548
3549 2010-04-02  Sergey Poznyakoff  <gray@gnu.org.ua>
3550
3551         Recode NEWS back to UTF-8
3552
3553 2010-04-01  Sergey Poznyakoff  <gray@gnu.org.ua>
3554
3555         Fix the gzip.at test case.
3556         * tests/gzip.at: Suppress gzip error output, as it can differ
3557         depending on its version etc. Bug reported by Ludovic Courtès.
3558
3559 2010-03-28  Sergey Poznyakoff  <gray@gnu.org.ua>
3560
3561         New option --full-time.
3562         * src/common.h (full_time_option): New global.
3563         * src/tar.c (FULL_TIME_OPTION): New constant.
3564         (options): New option --full-time.
3565         (parse_opt): Handle the --full-time option.
3566         * src/list.c (simple_print_header): Pass full_time_option
3567         as the 2nd argument to tartime.
3568         * doc/tar.texi: Update.
3569         * NEWS: Update.
3570
3571 2010-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>
3572
3573         Minor fixes in the testsuite.
3574         * tests/extrac07.at: Fix a typo (invalid number
3575         of arguments before format list).
3576         * tests/link02.at: Use `ln' instead of `link'.
3577         * tests/link03.at: Likewise.
3578
3579         Fix coredump.
3580         * src/names.c (collect_and_sort_names): Remove
3581         entry from the table before freeing it.
3582
3583         Fix dead loop on extracting existing symlinks with the -k option.
3584         * src/extract.c (create_placeholder_file)
3585         (extract_link, extract_symlink)
3586         (extract_node, extract_fifo): Handle all possible
3587         return values from maybe_recoverable. This complements
3588         8f390db92fc. Reported by Ico Doornekamp <bug-tar@zevv.nl>.
3589         * NEWS: Update.
3590
3591 2010-03-20  Sergey Poznyakoff  <gray@gnu.org.ua>
3592
3593         Fix undesired error exit on receiving SIGPIPE.
3594         * src/tar.c: Do not ignore SIGPIPE.
3595         * tests/sigpipe.at: New testcase.
3596         * tests/Makefile.am, tests/testsuite.at: Add sigpipe.at
3597         * tests/remfiles01.at: Fix error code expectation.
3598         * NEWS: Update.
3599
3600 2010-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>
3601
3602         Fix --remove-files.
3603         Tar --remove-files relied on canonicalize_file_name,
3604         which replaces symlinks in file name components with
3605         the directories they point to. Due to this, tar
3606         effectively ignored existence of symbolic links and
3607         was unable to remove a directory that contained any
3608         (Alexander Kozlov <akozlov@nada.kth.se>, 2010-03-15).
3609         * gnulib.modules: Remove canonicalize.
3610         * src/misc.c (normalize_filename): Rewrite
3611         from scratch. The function operates only on
3612         its input string, it makes no attempt to test
3613         components for existence or to resolve symbolic
3614         links.
3615         * tests/Makefile.am (TESTSUITE_AT): Add remfiles03.at.
3616         * tests/testsuite.at: Likewise.
3617         * tests/remfiles03.at: New test case.
3618         * NEWS: Update.
3619
3620 2010-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
3621
3622         Bugfixes.
3623         * src/buffer.c (check_label_pattern): Initialize result.
3624         * tests/remfiles01.at: Skip if run with root privileges.
3625
3626 2010-03-11  Sergey Poznyakoff  <gray@gnu.org.ua>
3627
3628         Fix `--test-label' and `--label -r' behavior.
3629         * doc/tar.texi (Including a Label in the Archive): Revise
3630         the section.
3631         * NEWS: Update
3632         * src/buffer.c (open_archive): Check volume label on
3633         ACCESS_UPDATE as well.
3634         * src/list.c (test_archive_label): Rewrite to match the
3635         documentation.
3636         * src/names.c (regex_usage_warning): Return int.
3637         (names_notfound): Rewrite the conditional.
3638         (label_notfound): New function.
3639         * tests/label03.at: New testcase.
3640         * tests/label04.at: New testcase.
3641         * tests/label05.at: New testcase.
3642         * tests/Makefile.am: Add new testcases.
3643         * tests/testsuite.at: Likewise.
3644
3645         Doc fixes.
3646         * doc/tar.texi: Consistently use lowercase `see' within sentences.
3647         More fixes spotted by Denis Excoffier.
3648         * THANKS: Update.
3649
3650         Shut up a gcc warning message.
3651         * src/tar.c (tar_help_filter): Use a separate const
3652         variable to hold returns from gettext. Reported by
3653         Peter Breitenlohner.
3654
3655         Bugfix.
3656         * src/names.c (collect_and_sort_names): Initialize prev_name.
3657         Reported by Dmitry V. Levin.
3658
3659 2010-03-10  Sergey Poznyakoff  <gray@gnu.org.ua>
3660
3661         Version 1.23
3662         * configure.ac, NEWS: Update version number.
3663
3664         Doc changes.
3665         * NEWS: Update.
3666         * THANKS: Update.
3667         * doc/snapshot.texi, doc/snapshot.texi,
3668         doc/sparse.texi, doc/tar-snapshot-edit.texi,
3669         doc/tar.texi: Spellchecked and proof-read. Thanks
3670         to Denis Excoffier.
3671         * gnulib.modules: Remove utime.
3672
3673 2010-03-08  Kamil Dudka  <kdudka@redhat.com>
3674
3675         Fix possible overflow in code_timespec (tiny change)
3676         * src/misc.c (code_timespec): ignore invalid values of ns
3677
3678 2010-03-08  Sergey Poznyakoff  <gray@gnu.org.ua>
3679
3680         Minor fix in the testsuite.
3681         * tests/extrac05.at: Skip test if creating
3682         sparse file fails.
3683
3684         Fix eventual memory override and fd exhaustion in create.c Both
3685         bugs reported by Kamil Dudka.
3686         * src/create.c (check_exclusion_tags): Do not keep
3687         pointer to a location within tagname: it may change
3688         after xrealloc. Use byte offset instead.
3689         (dump_file0): Close fd before returning without
3690         dumping the directory.
3691
3692 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
3693
3694         Minor change.
3695         * doc/tar.texi: Improve some wording.
3696
3697 2010-03-02  Antonio Diaz Diaz  <ant_diaz@teleline.es>
3698
3699         Add Lzip support
3700         * configure.ac: Add TAR_COMPR_PROGRAM(lzip)
3701         * doc/tar.texi: Reflect lzip support.
3702         * src/buffer.c (compress_type) <ct_lzip>: New constant.
3703         (magic): Add magic for lzip.
3704         * src/suffix.c (compression_suffixes): Add lz.
3705         * src/tar.c: New option --lzip.
3706
3707 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
3708
3709         Minor fix.
3710         * tests/exclude05.at: Rewrite awk invocation to avoid
3711         overflowing awk's file table on Solaris.
3712
3713 2010-03-02  Eric Blake  <ebb9@byu.net>
3714
3715         Fix large file support.
3716         * scripts/xsparse.c (read_map): Use fseeko.
3717         * src/incremen.c (write_directory_file): Likewise.
3718
3719 2010-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>
3720
3721         Bugfix
3722         * src/buffer.c (seek_archive): Rewrite size computation
3723         to prevent it from reaching negative values. Based on
3724         report by Denis Excoffier <Denis.Excoffier@free.fr>.
3725
3726 2010-02-25  Sergey Poznyakoff  <gray@gnu.org.ua>
3727
3728         Supply more information to the --to-command script.
3729         * src/system.c (stat_to_env): Pass information about the current
3730         volume in variables TAR_ARCHIVE, TAR_VOLUME, TAR_BLOCKING_FACTOR,
3731         TAR_FORMAT.
3732         * doc/tar.texi: Document new environment variables.
3733         * NEWS: Likewise.
3734         * configure.ac: Version number 1.22.91.
3735
3736 2010-02-17  Sergey Poznyakoff  <gray@gnu.org.ua>
3737
3738         Minor change.
3739         * src/names.c (regex_usage_warning): Fix warning message.
3740
3741 2010-02-05  Sergey Poznyakoff  <gray@gnu.org.ua>
3742
3743         Update THANKS
3744
3745 2010-02-05  OndÅ™ej Vašík  <ovasik@redhat.com>
3746
3747         Bugfix (tiny change)
3748         * src/xheader.c (xheader_read): Remove unnecessary call
3749         to xheader_init.
3750
3751 2010-01-26  Sergey Poznyakoff  <gray@gnu.org.ua>
3752
3753         Enable silent build mode.
3754         * configure.ac: Require automake 1.11, autoconf 2.63. Enable
3755         silent rules.
3756         * NEWS: Update.
3757         * lib/Makefile.am (rmt-command.h): Silent the rule.
3758
3759 2010-01-25  Sergey Poznyakoff  <gray@gnu.org.ua>
3760
3761         Read POSIX multivolume archives split at the header boundary.
3762         * src/common.h (read_header_mode): New enum.
3763         (read_header): Change type of the 3rd argument.
3764         * src/list.c (read_header): Change type of the 3rd argument.
3765         All callers updated.
3766         * src/buffer.c (try_new_volume): Allow for volumes split at the
3767         extended/ustar header boundary. This is against POSIX specs, but
3768         we must be able to read such archives anyway.
3769         * tests/multiv07.at: New test case.
3770         * tests/Makefile.am: Add multiv07.at
3771         * tests/testsuite.at: Likewise.
3772         * src/compare.c: Update calls to read_header.
3773         * src/delete.c: Likewise.
3774         * src/update.c: Likewise.
3775
3776 2010-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3777
3778         Minor change.
3779         * NEWS: Update.
3780         * doc/tar.texi: Update.
3781         * src/create.c (finish_header): Minor change.
3782
3783 2010-01-24  Rob Vermaas  <rob.vermaas@gmail.com>
3784
3785         Bugfix (tiny change).
3786         * src/tar.c (format_default_settings)[REMOTE_SHELL]: Fix
3787         misplaced comma.
3788
3789 2010-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>
3790
3791         Minor fix.
3792         * src/incremen.c (read_incr_db_01)
3793         (read_directory_file): Initialize bufsize to 0.
3794         Suggested by noordsij@cs.helsinki.fi.
3795
3796         Improve handling of --test-label.
3797         * src/list.c (print_volume_label): New function.
3798         (print_header): Call print_volume_label.
3799         (test_archive_label): New function.
3800         * src/buffer.c (VOLUME_LABEL_APPEND): Remove.
3801         (VOLUME_TEXT, VOLUME_TEXT_LEN): New macros
3802         (drop_volume_label_suffix): New function.
3803         (check_label_pattern): Use drop_volume_label_suffix.
3804         * src/common.h (subcommand): New constant TEST_LABEL_SUBCOMMAND.
3805         (test_label_option): Remove.
3806         (drop_volume_label_suffix): New proto.
3807         (test_archive_label): New proto.
3808         * src/names.c (all_names_found): Remove test for
3809         test_label_option.
3810         * src/tar.c (subcommand_string): Handle TEST_LABEL_SUBCOMMAND.
3811         (set_subcommand_option): Improve diagnostics.
3812         (parse_opt): Set subcommand if --test-label is given.
3813         (main): Handle TEST_LABEL_SUBCOMMAND.
3814
3815         Fix listing of volume labels (in particular in PAX archives).
3816         * src/buffer.c (match_volume_label): Call set_volume_label.
3817         (check_label_pattern): Get label string
3818         as argument.
3819         (match_volume_label): Handle volume labels stored in
3820         global PAX headers.
3821         * src/common.c (print_header,read_header): Change signature.
3822         (read_header_primitive): Remove prototype.
3823         * src/list.c (recent_global_header): New static.
3824         (list_archive): Always print volume labels.
3825         (read_header_primitive): Remove.
3826         (read_header): Change the signature (all callers updated)
3827         Save the recent global header.
3828         (volume_label_printed): New static.
3829         (simple_print_header): New function (ex-print_header).
3830         (print_header): Change the signature (all callers updated).
3831         For POSIX formats, print first volume header (if set).
3832         * src/xheader.c (xheader_write_global): Write the data
3833         accumulated in xhdr->stk even if keyword_global_override_list
3834         is empty.
3835         (xheader_read): On unexpected EOF, report error instead of
3836         coredumping.
3837         (XHDR_PROTECTED, XHDR_GLOBAL): New defines.
3838         (struct xhdr_tab): Remove `protected' with `flags'. All uses
3839         updated.
3840         (decg): If XHDR_GLOBAL bit is set, call the keyword's decode
3841         method instead of adding it to `kwl'.
3842         * src/compare.c: Update calls to read_header.
3843         * src/create.c: Likewise.
3844         * src/delete.c: Likewise.
3845         * src/update.c: Likewise.
3846         * src/extract.c: Likewise.
3847         (extract_volhdr): Do not print "Reading <label>" statement,
3848         because
3849         it is inconsistent: it is not printed if the volume begins with a
3850         member continued from the previous volume.
3851         * tests/label01.at: New testcase.
3852         * tests/label02.at: New testcase.
3853         * tests/Makefile.am, tests/testsuite.at: Add new testcases.
3854
3855 2010-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>
3856
3857         Fix prefix length calculation in ustar mode.
3858         * src/create.c (split_long_name): Fix prefix length
3859         calculation.
3860         (write_ustar_long_name): Improve ustar mode compatibility
3861         with the Sun version.
3862
3863 2009-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
3864
3865         Rewrite update algorithm.
3866         * src/common.h (namebuf_t): New typedef.
3867         (namebuf_create, namebuf_free)
3868         (namebuf_name): New prototypes.
3869         (remname): New prototype.
3870         * src/misc.c (struct namebuf): New structure.
3871         (namebuf_create, namebuf_free)
3872         (namebuf_name): New functions.
3873         * src/create.c (dup_dir0): Remove is_avoided_name
3874         checks. This is taken care of in update_archive.
3875         * src/incremen.c (scan_directory): Use namebuf
3876         to produce full file names.
3877         * src/names.c (nametail): Remove extra level of
3878         indirection. All uses updated.
3879         (avoided_name_table, add_avoided_name)
3880         (is_avoided_name): Remove.
3881         * src/update.c (update_archive): Change algorithm.
3882         Instead of adding unmodified files to the avoided_name
3883         table, create namelist so that it contains only
3884         modified files.
3885         * tests/Makefile.am: Add update01.at, update02.at
3886         * tests/testsuite.at: Likewise.
3887         * tests/update.at (AT_KEYWORDS): Add update00.
3888
3889         Minor changes.
3890         * src/tar.c (main): Ignore SIGPIPE.
3891         * src/system.c (sys_child_open_for_compress)
3892         (sys_child_open_for_uncompress): Reset SIGPIPE
3893         in child to default.
3894         * tests/remfiles01.at: Avoid race conditions.
3895         * tests/remfiles02.at: Likewise.
3896
3897         Bugfix.
3898         * src/buffer.c (_open_archive): Call guess_seekable_archive
3899         only if the call to open_compressed_archive succeeded.
3900
3901 2009-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>
3902
3903         Improve previous changes.
3904         * acinclude.m4: Fix typos.
3905         * gnulib.modules: Add xvasprintf.
3906         * src/common.h: Include xvasprintf.h.
3907         * src/tar.c (options): Remove docstrings for --gzip, --bzip2,
3908         --compress, --lzop, --lzma and --xz.
3909         (tar_help_filter): Generate these using actual values of
3910         *_PROGRAM constants.
3911         (format_default_settings): Use xasprintf.
3912         (parse_opt): Use *_PROGRAM defines instead of hardcoded
3913         program names.
3914
3915         Allow installers to specify alternative program names for
3916         compression programs.
3917         This adds --with-gzip, --with-bzip2 etc. switches to the
3918         configure, so that
3919         one can do, e.g. ./configure --with-bzip2=lbzip2 and have
3920         lbzip2 executed
3921         whenever user calls `tar --bzip2'.
3922         * acinclude.m4: New file.
3923         * configure.ac: Add TAR_COMPR_PROGRAM invocations for
3924         the supported compressors.
3925         * src/buffer.c (magic): Use *_COMPRESSOR defines instead
3926         of hardcoded program names.
3927         * src/suffix.c (compression_suffixes): Likewise.
3928
3929 2009-10-09  Sergey Poznyakoff  <gray@gnu.org.ua>
3930
3931         Minor fix.
3932         * src/buffer.c (magic): Fix `xz' entry: add the name of the
3933         program.
3934         * src/suffix.c (compression_suffixes, nsuffixes): Mark as static.
3935
3936 2009-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>
3937
3938         Provide a way to explicitly set mtime for extended header
3939         ustar blocks.
3940         * src/tar.c (struct textual_date): ts is a copy of the structure,
3941         not a pointer to it. Date is a copy as well, hence the `const' is
3942         taken away.
3943         (get_date_or_file): Return 0/1 depending on success/failure.
3944         Copy timestamp to the `ts' member. Store a copy of the string
3945         in `date'.
3946         (report_textual_dates): Report only if verbose_option is set,
3947         but always free the list.
3948         (expand_pax_option): New function.
3949         (parse_opt): Preprocess the argument to xheader_set_option with
3950         expand_pax_option.
3951         (decode_options): Call report_textual_dates unconditionally.
3952         * src/xheader.c (exthdr_mtime_option, exthdr_mtime)
3953         (globexthdr_mtime_option, globexthdr_mtime): New statics.
3954         (xheader_set_keyword_equal): handle exthdr.mtime and
3955         globexthdr.mtime.
3956         (xheader_write): Override `t' argument if a corresponding
3957         exthdr.mtime or globexthdr.mtime option is set.
3958         * NEWS: Update
3959         * doc/tar.texi: Document the changes.
3960
3961         Use file's mtime as mtime for its extended header.
3962         This makes two pax archives binary equivalent if they
3963         have the same contents and care is taken to make extended
3964         headers otherwise reproducible, e.g. by using:
3965           --pax-option=exthdr.name=%d/PaxHeaders/%f,atime:=0
3966         Proposed by Michael D. Adams <mdmkolbe@gmail.com>.
3967         * src/common.h (start_private_header): Take time_t as 3rd param.
3968         (xheader_write): Likewise.
3969         * src/create.c (start_private_header): Take time_t as 3rd param.
3970         All callers updated.
3971         (write_extended): Use file's mtime as mtime for its extended
3972         header,
3973         Use current time stamp as mtime for global headers.
3974         (xheader_write): Take time_t as 3rd param.
3975
3976         Fix bugs in handling the --remove-files option.
3977         Make sure the files are deleted only if they were successfully
3978         stored
3979         to the archive.
3980         * src/exit.c: New file.
3981         * src/unlink.c: New file.
3982         * src/Makefile.am (tar_SOURCES): Add exit.c and unlink.c.
3983         * src/common.h: Include progname.h
3984         (program_name): Remove global.
3985         (records_written): New extern.
3986         (queue_deferred_unlink, finish_deferred_unlinks): New prototypes.
3987         (fatal_exit_hook): New extern.
3988         * src/create.c (create_archive): Call finish_deferred_unlinks.
3989         (dump_hard_link, dump_file0): Don't actually unlink the file,
3990         queue it to deferred_unlinks instead.
3991         * src/delete.c (records_written): Remove extern: declared in
3992         common.h.
3993         * src/extract.c (extract_archive): Set fatal_exit_hook.
3994         (fatal_exit, xalloc_die): Move to exit.c
3995         * src/system.c (sys_wait_for_child): Exit immediately
3996         if the child dies or exits with a non-zero status.
3997         (sys_child_open_for_compress)
3998         (sys_child_open_for_uncompress): Use set_program_name,
3999         instead of setting program_name directly.
4000         * src/tar.c (main): Use set_program_name,
4001         instead of setting program_name directly.
4002         * tests/Makefile.am (TESTSUITE_AT): Add remfiles01.at
4003         and remfiles02.at.
4004         * tests/testsuite.at: Likewise.
4005         * tests/gzip.at: Reflect the above changes.
4006
4007 2009-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
4008
4009         Fix bug in OLDGNU format creation.
4010         See tests/append02.at for a detailed description
4011         * src/common.h (MODE_FROM_HEADER): Take additional argument.
4012         (mode_from_header): Likewise.
4013         * src/create.c (mode_to_chars): Store all mode bits if
4014         using OLDGNU_FORMAT. This reverses f4e4adea80a.
4015         * src/list.c (decode_header): Use header mode field
4016         to discern between GNU and OLDGNU formats.
4017         (mode_from_header): Store unrecognized mode bits (from 10th up)
4018         in the location pointed to by the third parameter.
4019         * tests/append02.at: Update documentation and references.
4020
4021 2009-09-16  Sergey Poznyakoff  <gray@gnu.org.ua>
4022
4023         Restore extra help output.
4024         * src/tar.c (tar_list_quoting_styles): Change first argument to
4025         struct obstack.
4026         (format_default_settings): New function.
4027         (show_default_settings)
4028         (show_default_settings_fs): Removed.
4029         (tar_help): Removed.
4030         (tar_help_filter): New function.
4031         (argp): Set help_filter.
4032         (parse_opt): Fix error message.
4033
4034 2009-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>
4035
4036         Improve command line option handling.
4037         * gnulib.modules: Add argp-version-etc and progname,
4038         use getopt-gnu instead of getopt.
4039         * src/tar.c (HANG_OPTION, USAGE_OPTION)
4040         (VERSION_OPTION): Remove.
4041         (options): Remove corresponding options. Let argp
4042         handle them.
4043         (parse_opt): Likewise.
4044         (_argp_hang): Removed.
4045         (tar_authors): New variable.
4046         (decode_options): Call argp_version_setup.
4047         Do not use ARGP_NO_HELP flag in the call to argp_parse.
4048
4049         Avoid overwriting exit_status with a value indicating less
4050         important condition.
4051         * src/tar.c (set_exit_status): New function.
4052         * src/common.h (set_exit_status): New prototype.
4053         * src/compare.c: Use set_exit_status instead of
4054         exit_status assignments.
4055         * src/create.c: Likewise.
4056         * src/misc.c: Likewise.
4057         * src/system.c (wait_for_grandchild): Use auto variable
4058         instead of the global exit_status.
4059         * src/incremen.c (scan_directory): Use file_removed_diag
4060         instead of stat_diag.
4061
4062         Automatic detection of seekable archives.
4063         * src/buffer.c (guess_seekable_archive): New function.
4064         (_open_archive): Call guess_seekable_archive for archives
4065         open for reading.
4066         (new_volume): Likewise.
4067         * src/common.h (seek_option): New global.
4068         * src/tar.c (options): New option --no-seek.
4069         (parse_opt): --seek and --no-seek set seek_option,
4070         not seekable_archive.
4071         (decode_options): Initialize seek_option to -1.
4072         * NEWS: Update.
4073         * doc/tar.texi: Update.
4074
4075 2009-08-27  Sergey Poznyakoff  <gray@gnu.org.ua>
4076
4077         Fix testcases.
4078         * tests/extrac08.at: Ensure a predictable umask value.
4079         * tests/xform-h.at (xform): do not depend on file name
4080         ordering.
4081
4082 2009-08-13  Sergey Poznyakoff  <gray@gnu.org.ua>
4083
4084         Fix interaction between --listed-incremental and -C
4085         * src/incremen.c (read_directory_file): Execute eventual -C dir
4086         after opening the snapshot file.
4087         (collect_and_sort_names): Remove call to chdir_do
4088         * tests/incr05.at, tests/incr06.at: Use relative file names for
4089         snapshot files.
4090
4091 2009-08-12  Sergey Poznyakoff  <gray@gnu.org.ua>
4092
4093         Update for new exclude module from gnulib. Add testcases by
4094         Phil Proudman.
4095         * src/names.c (is_pattern): Remove.
4096         (regex_usage_warning): Use fnmatch_pattern_has_wildcards
4097         instead of
4098         is_pattern.
4099         * src/tar.c: New option --exclude-backups.
4100         (vcs_file_table, backup_file_table): New globals.
4101         (add_exclude_array): New function.
4102         * tests/exclude01.at, tests/exclude02.at,
4103         tests/exclude03.at, tests/exclude04.at,
4104         tests/exclude05.at: New testcases. Supplied by Phil Proudman.
4105         * tests/Makefile.am (TESTSUITE_AT): Add new tests.
4106         * tests/testsuite.at: Add new tests.
4107         * THANKS: Update.
4108
4109 2009-08-10  Sergey Poznyakoff  <gray@gnu.org.ua>
4110
4111         Remove src/version.c (reappeared after migration to Git)
4112
4113 2009-08-09  Sergey Poznyakoff  <gray@gnu.org.ua>
4114
4115         Minor fixes.
4116         * src/misc.c (file_removed_diag): Set exit code to
4117         TAREXIT_DIFFERS.
4118
4119 2009-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>
4120
4121         Minor fixes
4122
4123         Fix handling of files removed during incremental dumps.
4124         Changes to src/create.c and src/incremen.c are partially
4125         based on patch from Alexander Peslyak <solar at openwall.com>.
4126         The new testcases require paxutils commit f653a2b or later.
4127         * src/common.h (struct name): New member `cmdline'.
4128         (dump_file): Change type of the 2nd argument to bool.
4129         (file_removed_diag, dir_removed_diag): New prototypes.
4130         (addname): New argument `cmdline'.
4131         (name_from_list): Change return value.
4132         * src/create.c (dump_dir0, dump_dir): top_level is bool.
4133         (create_archive): Update calls to name_from_list.
4134         Take advantage of the name->cmdline to set top_level argument
4135         during incremental backups.
4136         (dump_file0): top_level is bool.
4137         Do not bail out if a no-top-level file disappears during
4138         incremental
4139         backup, use file_removed_diag instead.
4140         (dump_filed): top_level is bool.
4141         * src/incremen.c (update_parent_directory): Silently ignore
4142         ENOENT.  It should have already been reported elsewhere.
4143         (scan_directory): Use dir_removed_diag to report missing
4144         directories.
4145         * src/misc.c (file_removed_diag, dir_removed_diag): New functions.
4146         * src/names.c (name_gather): Set ->cmdname.
4147         (addname): Likewise. All uses updated.
4148         (name_from_list): Return struct name const *. All uses updated.
4149         * tests/filerem01.at: New testcase.
4150         * tests/filerem02.at: New testcase.
4151         * tests/Makefile.am, tests/testsuite.at: Add filerem01.at,
4152         filerem02.at
4153         * tests/grow.at, test/truncate.at: Use new syntax for genfile
4154         --run.
4155         * NEWS: Update.
4156         * doc/tar.texi: Minor fix.
4157
4158         Optimize searches for directory structures by keeping a pointer
4159         to struct directory in struct name.
4160         * src/common.h (struct name): New member `directory' replaces
4161         dir_contents. Rearrange members.
4162         (rebase_directory): Change signature.
4163         (scan_directory): Change signature.
4164         (name_fill_directory)
4165         (directory_contents, safe_directory_contents): New prototypes.
4166         (append_incremental_renames): Change signature.
4167         (replace_prefix): New proto.
4168         * src/compare.c (diff_dumpdir): Use directory_contents +
4169         scan_directory.
4170         * src/create.c
4171         * src/incremen.c (replace_prefix): Move to misc.c
4172         (rebase_directory): Rewrite.
4173         (scan_directory): Return pointer to struct directory.
4174         (directory_contents, safe_directory_contents): New functions.
4175         (get_directory_contents): Remove.
4176         (name_fill_directory): New function.
4177         (append_incremental_renames): Rewrite. This also fixes a memory
4178         leak.
4179         * src/names.c (name_gather, addname): Reflect changes in struct
4180         name.
4181         (add_hierarchy_to_namelist): Rewrite using name_fill_directory and
4182         directory_contents.
4183         (rebase_child_list): Update call to rebase_directory.
4184         (collect_and_sort_names): Optimize
4185         * src/misc.c (replace_prefix): New function.
4186         * src/names.c (add_hierarchy_to_namelist): Use new
4187         get_directory_contents.
4188         * tests/incr05.at: New test case.
4189         * tests/incr06.at: New test case.
4190         * tests/Makefile.am, test/testsuite.at: Add incr05.at and
4191         incr06.at.
4192         * doc/Makefile.am (check-options): Improve rule.
4193         * doc/tar.texi, NEWS: Update.
4194
4195 2009-08-07  Sergey Poznyakoff  <gray@gnu.org.ua>
4196
4197         Minor fixes.
4198         * src/common.h (rebase_directory): New prototype.
4199         * src/incremen.c (rebase_directory): Use replace_prefix.
4200         * src/names.c (collect_and_sort_names): Abort if
4201         hash_insert fails.
4202
4203         Improve listed incremental dumps.
4204         The modified algorithm tries to avoid dumping the same
4205         directory twice and ensures the order of the directories
4206         in the resulting archive is the same, whatever their order
4207         on the command line.  It also fixes the operation of
4208         --listed-incremental -C.
4209         * gnulib.modules: Add canonicalize
4210         * src/common.h (incremental_level): New global.
4211         (check_exclusion_tags): first argument is const.
4212         (get_directory_contents): Add third argument.
4213         (zap_slashes, normalize_filename): New prototypes.
4214         (chdir_count): New prototype.
4215         (WARN_VERBOSE_WARNINGS): New define.
4216         (WARN_ALL): Exclude WARN_VERBOSE_WARNINGS.
4217         * src/compare.c (diff_dumpdir): Update the call to
4218         get_directory_contents.
4219         * src/create.c (check_exclusion_tags): First argument is const.
4220         Use ISSLASH and DIRECTORY_SEPARATOR instead of referring to '/'.
4221         * src/incremen.c (struct directory): New member `caname'.
4222         (hash_directory_name): Rename to
4223         hash_directory_canonical_name. Operate
4224         on the canonical name.
4225         (compare_directory_names): Rename to
4226         compare_directory_canonical_names.
4227         Operate on the canonical name.
4228         (make_directory): Take two arguments.
4229         (free_directory): Free caname.
4230         (attach_directory): Create caname.
4231         (find_directory): Use caname for lookups.
4232         (PD_VERBOSE): Remove.
4233         (PD_FORCE_INIT): New define.
4234         (procdir): First argument is const.
4235         Reinitialize directory if PD_FORCE_INIT bit is set.
4236         Do not use PD_VERBOSE or verbose_option for issuing warnings.
4237         Rely on WARNOPT instead.
4238         Always set *entry.
4239         (scan_directory): Take three arguments. The third one is a boolean
4240         which is true if the directory is explicitly mentioned on
4241         the command
4242         line.
4243         (get_directory_contents): Remove.  Use scan_directory instead.
4244         All callers updated.
4245         (read_directory_file): Truncate the file if --level=0 is given.
4246         * src/misc.c: Include canonicalize.h
4247         (zap_slashes, normalize_filename): New functions.
4248         (chdir_count): New function.
4249         * src/names.c (add_hierarchy_to_namelist): Take three arguments,
4250         as
4251         get_directory_contents and scan_directory.
4252         (collect_and_sort_names): Allow at most one -C, before file name
4253         arguments.
4254         Read directory file after eventual changing to another directory.
4255         Avoid adding the same directory under different pathnames to
4256         the list.
4257         * src/tar.c: New option --level.
4258         * tests/incr03.at, tests/incr04.at, tests/listed01.at,
4259         tests/listed02.at, tests/rename01.at, tests/rename02.at,
4260         tests/rename03.at: Update for new tar behavior.
4261         * tests/multiv01.at: Do not use --listed-incremental.
4262
4263 2009-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
4264
4265         Forgotten to push src/warning.c
4266
4267         Implement the --warning option.
4268         * src/warning.c: New file.
4269         * src/Makefile.am: Add warning.c
4270         * src/common.h: Provide definitions for warning classes.
4271         (warning_option): New global.
4272         (WARNOPT): New define.
4273         (set_warning_option): New prototype.
4274         * src/tar.c: New option `--warning'.
4275         * src/compare.c: When applicable WARNOPT instead of WARN.
4276         * src/create.c: Likewise.
4277         * src/extract.c: Likewise.
4278         * src/incremen.c: Likewise.
4279         * src/list.c: Likewise.
4280         * NEWS, doc/tar.texi: Update.
4281
4282 2009-08-05  Carl Worth  <cworth@cworth.org>
4283
4284         Fix descriptions of some options (tiny change)
4285
4286 2009-08-05  Sergey Poznyakoff  <gray@gnu.org.ua>
4287
4288         Fix backup handling and restoring file modes of existing
4289         directories
4290         * NEWS, THANKS: Update
4291         * src/extract.c (extract_dir): reset status to 0 if the
4292         directory already exists.
4293         * src/misc.c (maybe_backup_file): Assign before_backup_name
4294         and clear after_backup_name before checking if we really need
4295         to backup the file.
4296         * tests/backup01.at: New testcase.
4297         * tests/extrac08.at: New testcase.
4298         * tests/Makefile.am, tests/testsuite.at: Add extrac08.at and
4299         backup01.at
4300
4301 2009-07-30  Sergey Poznyakoff  <gray@gnu.org.ua>
4302
4303         Fix hard links recognition with -c --remove-files
4304         * src/create.c (dump_hard_link): Always look up in the link table
4305         if remove_files_option is set. Patch suggested by Theodore Ts'o
4306         <tytso@mit.edu>.
4307         (check_links): Remove extra newline from the warning message.
4308         * tests/link02.at, tests/link03.at: New testcases.
4309         * tests/Makefile.am (TESTSUITE_AT): Add link02.at and link03.at
4310         * tests/testsuite.at: Include link02.at and link03.at
4311
4312         Fix handling of hard link targets by -c --transform
4313         * src/create.c (file_count_links): Transform link target
4314         before the look up.
4315         * tests/xform-h.at: New test case.
4316         * tests/Makefile.am (TESTSUITE_AT): Add xform-h.at.
4317         * tests/testsuite.at: Add xform-h.at
4318
4319 2009-06-23  Sergey Poznyakoff  <gray@gnu.org.ua>
4320
4321         Minor fix.
4322         * src/extract.c (file_newer_p): Do not report error on ENOENT
4323
4324 2009-06-19  Sergey Poznyakoff  <gray@gnu.org.ua>
4325
4326         Remove rebox.el (reappeared after migration to Git)
4327
4328 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
4329
4330         Remove files that were removed in CVS, but reappeared after
4331         migration to Git
4332
4333 2009-06-18  David Bartley  <dtbartle@csclub.uwaterloo.ca>
4334
4335         Fix Solaris bug where chmod fails if we don't have
4336         PRIV_SYS_LINKDIR
4337         * gnulib.modules: Add priv-set.
4338         * src/extract.c (set_mode, extract_archive): Restore
4339         PRIV_SYS_LINKDIR on chmod failure.
4340         * src/tar.c (main): Drop PRIV_SYS_LINKDIR on startup.
4341
4342 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
4343
4344         Ensure default behavior for SIGPIPE
4345         * src/tar.c (main): Install default handler for SIGPIPE.
4346         Proposed by Bastian Blank.
4347
4348 2009-06-18  Eric Blake  <ebb9@byu.net>
4349
4350         Follow autoconf recommendation for TESTSUITEFLAGS.
4351         * tests/Makefile.am (check-local, installcheck-local): Honor
4352         TESTSUITEFLAGS.
4353
4354 2009-06-18  Sergey Poznyakoff  <gray@gnu.org.ua>
4355
4356         Fix handling of sub-subprocess returns.
4357         * src/system.c (wait_for_grandchild): New function.
4358         (sys_child_open_for_compress)
4359         (sys_child_open_for_uncompress): Use wait_for_grandchild
4360         to manage grandchild return.
4361
4362 2009-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
4363
4364         Report record size only if the archive refers to a device.
4365         * Makefile.am (INCLUDES): Add ../lib, for rmt-command.h
4366         * src/buffer.c (short_read): Report the actual record size
4367         only if the archive descriptor refers to a device.
4368         * tests/pipe.at, tests/shortrec.at,
4369         tests/sparsemvp.at: Reflect the above change.
4370         * NEWS, configure.ac: Version 1.22.90
4371
4372 2009-05-14  Sergey Poznyakoff  <gray@gnu.org.ua>
4373
4374         Do not issue errors on existing files when given the -k option
4375         * Makefile.am (dist-hook): Fix rule.
4376         * src/extract.c (maybe_recoverable): Return three-state value.
4377         (extract_dir): Skip extraction if maybe_recoverable indicates so.
4378         (extract_file): Likewise.
4379
4380 2009-05-12  Eric Blake  <ebb9@byu.net>
4381
4382         Avoid undefined behavior
4383         * src/xheader.c (xheader_set_keyword_equal): Pass correct type to
4384         ctype macros.
4385         * src/transform.c (run_case_conv): Likewise.
4386
4387 2009-05-12  Sergey Poznyakoff  <gray@gnu.org.ua>
4388
4389         Remove src/Makefile.in
4390
4391 2009-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
4392
4393         Bugfixes.
4394         * bootstrap (symlink_to_dir): Fix symlink calculation.
4395         * doc/tar.texi: Minor fixes by Victor Villa and Stepan Kasal.
4396
4397 2009-03-07  Sergey Poznyakoff  <gray@gnu.org.ua>
4398
4399         Remove Makefile.in
4400
4401         Migrate to Git
4402
4403 Currently the ChangeLog is generated automatically from the Git
4404 revision history, but from 1997 to 2009 the ChangeLog file was
4405 maintained by hand, under CVS.  This file records the older log.
4406
4407 Copyright 1997-2001, 2003-2009, 2013 Free Software Foundation, Inc.
4408
4409 This file is part of GNU tar.
4410
4411 GNU tar is free software; you can redistribute it and/or modify
4412 it under the terms of the GNU General Public License as published by
4413 the Free Software Foundation; either version 3 of the License, or
4414 (at your option) any later version.
4415
4416 GNU tar is distributed in the hope that it will be useful,
4417 but WITHOUT ANY WARRANTY; without even the implied warranty of
4418 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4419 GNU General Public License for more details.
4420
4421 You should have received a copy of the GNU General Public License
4422 along with this program.  If not, see <http://www.gnu.org/licenses/>.
4423
4424 2009-03-05  Sergey Poznyakoff  <gray@gnu.org.ua>
4425
4426         * src/incremen.c: --no-recursive works with --incremental.
4427
4428 2009-03-04  Sergey Poznyakoff  <gray@gnu.org.ua>
4429
4430         Add xz support.
4431
4432         * src/buffer.c, src/suffix.c: Add support for xz compression.
4433         * src/tar.c: New option --xz, for compression/decompression using xz.
4434         Re-assign -J as a short equivalent of --xz.
4435
4436 2009-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>
4437
4438         * doc/tar.texi: Fix typo.
4439
4440 2008-12-29  Sergey Poznyakoff  <gray@gnu.org.ua>
4441
4442         * bootstrap.conf: Include size_max.
4443         * gnulib.modules: Remove memset, rmdir. Replace strdup with
4444         strdup-posix. Patch by Eric Blake.
4445         * src/tar.c: Implement -I as a shorthand for --use-compress-program.
4446         * doc/tar.texi: Document -I.
4447         * tests/pipe.at, tests/shortrec.at: Account for eventual 'Record
4448         size' output.
4449         * tests/testsuite.at (AT_TAR_CHECK_HOOK): New define
4450         (AT_TAR_WITH_HOOK, TAR_IGNREC_HOOK): New macros.
4451
4452 2008-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>
4453
4454         * src/xheader.c: Remove duplicate inclusion of fnmatch.h. Reported
4455         by Jim Meyering.
4456
4457 2008-11-25  Sergey Poznyakoff  <gray@gnu.org.ua>
4458
4459         Do not try to drain the input pipe before closing the
4460         archive.
4461
4462         * src/buffer.c (close_archive): Remove call to
4463         sys_drain_input_pipe. Pass hit_eof as the second
4464         argument to sys_wait_for_child.
4465         * src/common.h (sys_drain_input_pipe): Remove
4466         (sys_wait_for_child): Declare second argument.
4467         * src/system.c (sys_drain_input_pipe): Remove.
4468         (sys_wait_for_child): Take two arguments. The second one helps to
4469         decide whether to tolerate child termination on SIGPIPE.
4470
4471 2008-11-03  Sergey Poznyakoff  <gray@gnu.org.ua>
4472
4473         * src/buffer.c (_write_volume_label): Fix typo, which prevented
4474         `-V label -M' from working.
4475
4476 2008-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>
4477
4478         * NEWS, configure.ac: Version 1.20.91
4479         * doc/tar.texi: Document transformation scope flags.
4480         * src/common.h (transform_symlinks_option): Remove in favor of
4481         transformation scope flags.
4482         (XFORM_REGFILE, XFORM_LINK, XFORM_SYMLINK, XFORM_ALL): New macros.
4483         (transform_name, transform_member_name, transform_name_fp): Take
4484         an additional argument, specifying scope flags.
4485         * src/create.c: Reflect changes to transform_name.
4486         * src/extract.c (extract_link, extract_symlink): Remove calls to
4487         transform_member_name. It is done in read_header.
4488         * src/list.c (decode_xform): Reflect change in data type of 2nd
4489         argument.
4490         (transform_member_name): 2nd arg is int.
4491         (decode_header): Transform file name and link target names.
4492         * src/tar.c: Remove --transform-symlinks.
4493         * src/transform.c (struct transform): New member `flags'.
4494         (transform_flags): New variable.
4495         (parse_transform_expr): Parse transformation scope flags. Allow to
4496         set global flags using `flags=' syntax.
4497         (_transform_name_to_obstack, transform_name_fp)
4498         (transform_name): Take an additional argument, specifying scope
4499         flags.
4500
4501 2008-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>
4502
4503         * THANKS: Add Ed Leaver.
4504         * src/buffer.c (short_read): Remove !read_full_records condition,
4505         which was always false on a first record and thus disabled record
4506         size autodetection.  Thanks Ed Leaver for the patch.
4507         (_gnu_flush_read): Handle blocking_factor == 1.
4508         * tests/sparsemv.at: Reflect changes to buffer.c.
4509         * tests/sparsemvp.at: Likewise.
4510         * tests/volsize.at: Likewise.
4511         * NEWS: Update.
4512
4513 2008-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>
4514
4515         * src/common.h (transform_symlinks_option): New global.
4516         * src/create.c (dump_file0): Transform symlink targets only if
4517         explicitly required.  Thanks Cyril Strejc for reporting the
4518         problem.
4519         * src/tar.c (parse_opt): New options --transform-symlinks and
4520         --no-transform-symlinks. New alias --xform to the --transform
4521         option.
4522         * doc/tar.texi: Document --transform-symlinks
4523         * NEWS: Update.
4524         * THANKS: Update.
4525
4526         * src/names.c (name_gather): Use xzalloc.
4527         * src/buffer.c (short_read): Move record size detection before
4528         the loop.
4529
4530 2008-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>
4531
4532         * src/tar.c (options): Add --lzop option.
4533
4534 2008-10-05  Xavier Hienne <xavier.hienne@free.fr> (tiny change)
4535
4536         * src/checkpoint.c (checkpoint_compile_action): Add missing
4537         `else'.
4538
4539 2008-09-24  Sergey Poznyakoff  <gray@gnu.org.ua>
4540
4541         * NEWS: Update.
4542         * doc/tar.texi: Update.
4543         * src/tar.c: New option --no-null.
4544
4545 2008-09-23  Sergey Poznyakoff  <gray@gnu.org.ua>
4546
4547         * src/common.h (filename_terminator): Remove global.
4548         * src/tar.c (filename_terminator): New static.
4549         * src/names.c (name_next_elt): Do not depend on
4550         filename_terminator, this was a leftover from 1.13.
4551
4552 2008-09-18  Sergey Poznyakoff  <gray@gnu.org.ua>
4553
4554         * doc/tar.texi: Remove incorrect example.
4555
4556 2008-09-07  Sergey Poznyakoff  <gray@gnu.org.ua>
4557
4558         * src/incremen.c (dumpdir_create0): Eliminate gcc warning.
4559         (attach_directory): Bugfix - add missing return statement.
4560         * THANKS: Add Enric Hernandez
4561
4562 2008-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>
4563
4564         * src/incremen.c (struct directory): New member `next'.  Change
4565         type of `name'.
4566         (dirhead, dirtail): New statics.
4567         (make_directory): Reflect changes to struct directory.
4568         (free_directory, attach_directory): New functions.
4569         (dirlist_replace_prefix): New function.
4570         (note_directory): Use attach_directory, instead of make_directory,
4571         (find_directory, find_directory_meta): Use free_directory.
4572         (procdir): Replace directory prefixes in directory list to avoid
4573         marking subdirectories as renamed after renaming their parent
4574         directory.
4575         (append_incremental_renames): Iterate over directory list, not
4576         hash table, to preserve logical ordering of renames.
4577         * tests/rename04.at, tests/rename05.at: New test cases.
4578         * tests/Makefile.am, tests/testsuite.at: Add rename04.at and
4579         rename05.at.
4580         * tests/atlocal.in (decho): New function.
4581         * tests/multiv06.at: Use decho instead of echo2.
4582         * tests/incremental.at: Raise wait interval to 2 seconds.
4583
4584 2008-07-24  Sergey Poznyakoff  <gray@gnu.org.ua>
4585
4586         * src/tar.c (decode_options): Do not allow volume length less
4587         than record size.
4588         * src/buffer.c (_gnu_flush_write): Compensate for the effect
4589         of eventual flush_archive occurring in the middle of buffer
4590         move.
4591         Increment records_written only if _flush_write was able to write
4592         something.
4593         * tests/multiv06.at: New testcase.
4594         * tests/Makefile.am, test/testsuite.at: Add tests/multiv06.at
4595
4596 2008-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>
4597
4598         * configure.ac, NEWS: Version 1.20.90
4599         * doc/tar.texi: Document -J, --no-auto-compress, etc.
4600         * src/buffer.c (ct_tar): New constant.
4601         (magic): Add lzop support.  Proposed by Kevin Day
4602         <thekevinday@gmail.com>.
4603         (check_compressed_archive): Do not use autodetect if the
4604         compression program was specified explicitly.
4605         Fall back to analyzing archive name, if the autodetection fails.
4606         * src/suffix.c: Add .lzo
4607         * src/tar.c: New options --lzop and --no-auto-compress.
4608         New short option -J (alias for --lzma).
4609
4610         * src/buffer.c (try_new_volume): Print more information with error
4611         diagnostics.
4612         (_gnu_flush_write): Improve error checking.  Adjust
4613         real_s_sizeleft before calling new_volume to avoid creating
4614         malformed multivolume headers.
4615         * tests/delete05.at, tests/gzip.at, tests/ignfail.at,
4616         tests/longv7.at, tests/lustar01.at, tests/lustar02.at,
4617         tests/shortfile.at: Update to match new diagnostic wording
4618         (see 2008-05-06).
4619
4620         * NEWS: Update.
4621
4622 2008-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>
4623
4624         * doc/tar.texi (exclude): Document support for new VCS.
4625         * THANKS: Update.
4626         * NEWS: Update.
4627         * tests/multiv05.at: Fix typos.
4628         * tests/volsize.at: Remove a TZ dependency.
4629
4630 2008-06-14  Dan Drake <dan@dandrake.org> (tiny change)
4631
4632         * src/tar.c (exclude_vcs_files): Support for Bazaar, Mercurial and
4633         Darcs.
4634
4635 2008-05-06  Sergey Poznyakoff  <gray@gnu.org.ua>
4636
4637         * src/tar.c (main): Reword the "delayed error" message. New
4638         wording proposed by Karl Berry.
4639
4640 2008-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>
4641
4642         * configure.ac: Raise version number to 1.20
4643         * src/compare.c (diff_dumpdir): const.
4644         * src/common.h (dumpdir_t,dumpdir_iter_t): New data types.
4645         (dumpdir_create0,dumpdir_create,dumpdir_free,dumpdir_locate)
4646         (dumpdir_first,dumpdir_next): New functions.
4647         * src/incremen.c (dumpdir_create0,dumpdir_create,dumpdir_free)
4648         (dumpdir_first,dumpdir_next): New functions.
4649         (dumpdir_locate): Rewrite using binary search.
4650         (struct directory): Change members char *contents, *icontents to
4651         struct dumpdir *dump, *idump. All references updated.
4652         (note_directory): Last arg is const.
4653         * src/names.c (add_hierarchy_to_namelist): buffer is const.
4654         * tests/incr03.at, tests/incr04.at, tests/rename02.at,
4655         tests/rename03.at: Insert calls to sleep between creation of files
4656         and adding them to the archive.
4657
4658 2008-03-31  Sergey Poznyakoff  <gray@gnu.org.ua>
4659
4660         * src/create.c (dump_file0): Count links only for actually dumped
4661         files.
4662
4663 2008-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>
4664
4665         * NEWS: Document --no-check-device and --check-device.
4666         * doc/rendition.texi: Change the way FIXME-*refs are handled in
4667         !PROOF.
4668         * doc/intern.texi, doc/tar.texi: Update.
4669         * doc/untabify.el: New file.
4670         * doc/Makefile.am (EXTRA_DIST): Add untabify.el
4671         (untabify, final, check-format, check-refs, check-fixmes)
4672         (check-unrevised, all-check-docs, check-docs): New rules.
4673
4674         * src/common.h (check_device_option): New global.
4675         * src/incremen.c (procdir): Use boolean and instead of bitwise
4676         one. Patch by Jean-Louis Martineau.
4677         Compare device numbers only if check_device_option is set.
4678         * src/tar.c: New command line options --no-check-device and
4679         --check-device. Proposed by Jean-Louis Martineau.
4680         (parse_opt): Hanlde new options.
4681         (decode_options): Initialize check_device_option to true.
4682
4683         * THANKS: Update
4684
4685 2008-03-06  Sergey Poznyakoff  <gray@gnu.org.ua>
4686
4687         * bootstrap: Use rsync to get translations.
4688         * doc/tar.texi: Minor change.
4689         * lib/.cvsignore: Update
4690         * po/.cvsignore: Update
4691         * src/system.c: Remove include setenv.h.
4692         * tests/atlocal.in (STAR_DATA_URL): Update.
4693         * tests/star/README: Update URL.
4694
4695 2008-02-09  Sergey Poznyakoff  <gray@gnu.org.ua>
4696
4697         * doc/tar.texi: Fix a typo. Reported by Denis Excoffier.
4698
4699 2008-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
4700
4701         * NEWS: Update.
4702         * configure.ac: Version 1.19.90
4703         * po/POTFILES.in: Add missing files.
4704         * src/compare.c (verify_volume): Honor --ignore-zeros.
4705         Proposed by Jan-Benedict Glaw.
4706         * tests/shortfile.at (AT_KEYWORDS): Add shortfile0.
4707
4708 2008-02-07  Sergey Poznyakoff  <gray@gnu.org.ua>
4709
4710         * NEWS: Update.
4711         * src/create.c (dump_file0): Apply transform_name to symlink
4712         targets.
4713
4714 2008-02-04  Sergey Poznyakoff  <gray@gnu.org.ua>
4715
4716         * src/transform.c: Support multiple --transform options. Support
4717         semicolon-separated lists of replace expressions.
4718         * NEWS, tar.texi: Document changes to the --transform option.
4719
4720 2008-01-30  Paul Eggert  <eggert@cs.ucla.edu>
4721
4722         * doc/tar.texi: Update Back-Cover text to reflect new GNU wording.
4723
4724 2007-12-17  Paul Eggert  <eggert@cs.ucla.edu>
4725
4726         Exit with nonzero status if a close fails on an archive.
4727         Problem (and initial trivial fix)
4728         * src/buffer.c (close_archive, new_volume): close_error, not
4729         close_warn.
4730
4731 2007-12-05  Sergey Poznyakoff  <gray@gnu.org.ua>
4732
4733         * src/buffer.c (check_compressed_archive): Do not bail out if the
4734         file is too short, set boolean flag, passed as an argument
4735         instead.  This fixes a bug introduced on 2007-08-24. See also
4736         tests/shortupd.at.
4737
4738         * tests/Makefile.am, tests/testsuite.at: Add shortupd.at.
4739         * tests/shortupd.at: New test.
4740
4741 2007-11-12  Jim Meyering  <meyering@redhat.com>
4742
4743         Don't read from name[-1].
4744         * src/incremen.c (make_directory): Handle namelen == 0, since
4745         find_directory_meta calls make_directory ("").
4746
4747 2007-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
4748
4749         * bootstrap (checkout): Use URL of the gnulib CVS mirror.
4750         * gnulib.modules: Add fseeko and snprintf.
4751
4752 2007-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>
4753
4754         * src/checkpoint.c: New actions: bell and ttyout
4755         * src/system.c (sys_exec_info_script)
4756         (sys_exec_checkpoint_script): pass the current blocking factor in
4757         TAR_BLOCKING_FACTOR environment variable.
4758         * doc/tar.texi: Update
4759         * NEWS: Update
4760
4761 2007-10-30  Sergey Poznyakoff  <gray@gnu.org.ua>
4762
4763         * doc/Makefile.am: Use texi2html and the CVS version of gendocs.sh
4764         to create HTML versions of the manual.
4765         * doc/gendocs_template: Likewise.
4766         * doc/tar.texi: Document --hard-dereference and
4767         --checkpoint-action options. Improve documentation of
4768         --check-links.
4769
4770 2007-10-29  Sergey Poznyakoff  <gray@gnu.org.ua>
4771
4772         * NEWS: Update
4773         * configure.ac: Version 1.19.1
4774         * po/POTFILES.in: Add src/checkpoint.c
4775         * src/Makefile.am (tar_SOURCES): add checkpoint.c
4776         * src/checkpoint.c: New file - checkpoint handling.
4777         * src/buffer.c (checkpoint, do_checkpoint): Remove.
4778         (_flush_write, simple_flush_read, _gnu_flush_read): Use
4779         checkpoint_run.
4780         * src/common.h (enum checkpoint_style): Remove.
4781         (checkpoint_style): Remove.
4782         (DEFAULT_CHECKPOINT): New define.
4783         (hard_dereference_option): New variable.
4784         (sys_exec_checkpoint_script): New declaration.
4785         * src/create.c (file_count_links): do nothing if
4786         hard_dereference_option is set.
4787         * src/system.c (sys_exec_checkpoint_script): New function.
4788         (sys_exec_info_script): Restore SIGPIPE handler.
4789         * src/tar.c: (parse_opt): New options --hard-dereference,
4790         --checkpoint-action.
4791         (decode_options): Call checkpoint_finish_compile.
4792
4793         * src/system.c (sys_exec_info_script): Initialize buf. Problem
4794         reported by Bengt-Arne Fjellner.
4795
4796 2007-10-18  Jim Meyering  <jim@meyering.net>
4797
4798         Avoid compiler warnings.
4799         * src/list.c (read_header_primitive): Define two locals, to
4800         avoid incorrect "may be used uninitialized" warnings.
4801         * src/incremen.c (procdir): Remove decl of unused local, "len".
4802
4803 2007-10-18  Sergey Poznyakoff  <gray@gnu.org.ua>
4804
4805         * doc/tar.texi (gzip): Remove compression patent
4806         warning. According to Brett Smith, the patent is
4807         expired.
4808
4809 2007-10-17  Sergey Poznyakoff  <gray@gnu.org.ua>
4810
4811         * src/suffix.c: New file. Compress format detection by archive
4812         suffix (when creating). Suggested by Jean-Pierre Demailly.
4813         * src/Makefile.am: Add suffix.c
4814         * src/buffer.c (magic): Add an entry for new lzma format. Proposed
4815         by Lasse Collin.
4816         * src/common.h (set_comression_program_by_suffix): New prototype.
4817         * src/tar.c: New options --auto-compress (-a) and --lzma
4818         * THANKS: Add Lasse Collin and Jean-Pierre Demailly.
4819         * NEWS: Update
4820         * doc/tar.texi: Update
4821
4822 2007-10-12  Paul Eggert  <eggert@cs.ucla.edu>
4823
4824         * src/utf8.c (string_ascii_p): Recode to avoid bogus GCC 4.2.1
4825         warning about "comparison is always true due to limited range of
4826         data type" when char is unsigned.
4827
4828 2007-10-11  Paul Eggert  <eggert@cs.ucla.edu>
4829
4830         Adjust to recent gnulib changes.
4831         * configure.ac: Dont' check for strerror, since gnulib now does this.
4832         * .cvsignore: Add m4, tar-[0-9]*.
4833         * lib/.cvsignore: Adjust to various gnulib file name changes.
4834         Add .deps, rmt-command.h.
4835
4836 2007-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>
4837
4838         * configure.ac, NEWS: Raise version number to 1.19
4839         * tests/star/README: Update
4840
4841 2007-10-05  Sergey Poznyakoff  <gray@gnu.org.ua>
4842
4843         * src/create.c (dump_regular_file): Fix file padding in case of
4844         truncation to zero size.
4845         * NEWS: Update
4846
4847 2007-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
4848
4849         * tests/T-null.at: Use AT_DATA for sample output.
4850
4851 2007-10-03  Sergey Poznyakoff  <gray@gnu.org.ua>
4852
4853         * src/incremen.c (try_purge_directory): Ensure that arguments to T
4854         and R are safe.
4855
4856 2007-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>
4857
4858         * src/incremen.c (obstack_code_rename): Apply safer_name_suffix to
4859         name arguments before storing them in T and R records. Reported by
4860         Nicholas Cole.
4861
4862 2007-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>
4863
4864         * configure.ac: Raise version number to 1.18.90
4865         * NEWS: Likewise
4866
4867         * doc/snapshot.texi: Document version 2.
4868         * doc/dumpdir.texi: Update.
4869
4870         Implement --exclude-tag* and --exclude-cache* options for listed
4871         incremental archives.
4872         New option --exclude-vcs to exclude VCS-specific files and
4873         directories.
4874
4875         * NEWS: Update
4876         * doc/tar.texi: Document --exclude-vcs option
4877         * src/common.h (exclusion_tag_warning, check_exclusion_tags): New
4878         prototypes.
4879         * src/create.c (exclusion_tag_warning, check_exclusion_tags):
4880         Remove static qualifier.
4881         (check_exclusion_tags): account for dirname without terminating
4882         slash.
4883         (dump_dir0): exclusion_tag_all is handled elsewhere.
4884         * src/incremen.c (struct directory): New member tagfile
4885         (make_directory): Initialize tagfile to NULL
4886         (procdir): New argument: entry
4887         Hanlde exclusion tags.
4888         (makedumpdir): Take into account directory->tagfile.
4889         (scan_directory): Hanlde exclusion tags.
4890         * src/tar.c: New option --exclude-vcs
4891         (exclude_vcs_files): New function
4892
4893 2007-09-14  Paul Eggert  <eggert@cs.ucla.edu>
4894
4895         * AUTHORS: Remove unnecessary information.  Just list the
4896         principal authors.
4897         * THANKS: Remove info duplicated from AUTHORS.
4898
4899 2007-08-25  Jim Meyering  <jim@meyering.net>
4900
4901         Don't include <getline.h>.  No longer needed.
4902         * src/incremen.c: Don't include <getline.h>.  No longer needed.
4903         * src/buffer.c: Likewise.
4904         * src/system.c: Likewise.
4905         * src/tar.c: Likewise.
4906
4907         Avoid shadowing and unused-variable warnings.
4908         * src/create.c (check_exclusion_tags): Remove declaration of unused
4909         local, "ret".
4910         * src/compare.c (diff_dumpdir): Rename stat->stat_data to avoid
4911         shadowing the syscall.
4912         * src/buffer.c (do_checkpoint): Don't shadow the write syscall.
4913         (try_new_volume): Avoid shadowing "access".
4914         * src/tar.c (decode_options): Rename index->idx to avoid shadowing.
4915         (find_argp_option): Rename option->o to avoid shadowing.
4916         * src/incremen.c (scan_directory): Rename local, dir_name->dir,
4917         to avoid shadowing the function.
4918         (get_directory_contents): Likewise.
4919         * src/system.c (global_pid): Rename from "pid", to avoid being
4920         shadowed by locals.
4921         * src/extract.c (apply_nonancestor_delayed_set_stat):
4922         Rename st->sb to avoid shadowing another local.
4923
4924 2007-08-24  Sergey Poznyakoff  <gray@gnu.org.ua>
4925
4926         * configure.ac, NEWS: Raise version number to 1.18.1
4927
4928         * src/buffer.c (check_compressed_archive): Detect files smaller
4929         than 512 bytes.
4930         * tests/shortfile.at: New test case for the above change.
4931         * tests/testsuite.at, tests/Makefile.am: Add shortfile.at
4932
4933 2007-08-19  Sergey Poznyakoff  <gray@gnu.org.ua>
4934
4935         * bootstrap: Gnulib initialization destroyed paxutils m4 files.
4936         Initialize paxutils structure after that of gnulib.
4937
4938 2007-08-12  Sergey Poznyakoff  <gray@gnu.org.ua>
4939
4940         * src/names.c (contains_dot_dot): Fix double-dot recognition in
4941         case of duplicate /. Patch by Dmitry V. Levin.
4942
4943         * bootstrap (symlink_to_gnulib): Make sure the target directory
4944         exists and create it if it does not.
4945
4946         * doc/tar.texi: Fix a typo.
4947
4948 2007-06-28  Sergey Poznyakoff  <gray@gnu.org.ua>
4949
4950         * bootstrap: Update for the change of the TP URL
4951
4952 2007-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>
4953
4954         Relicense under GPLv3
4955
4956 2007-06-21  Sergey Poznyakoff  <gray@gnu.org.ua>
4957
4958         * tests/testsuite.at (AT_TAR_MKHIER): Skip test if genfile is
4959         unable to create the file
4960         * tests/lustar01.at: Likewise
4961
4962 2007-06-21  Eric Blake  <ebb9@byu.net>
4963
4964         Resolve testsuite failures 40-42 on cygwin.
4965         * tests/testsuite.at (AT_TAR_MKHIER): Skip tests when long
4966         file names cannot be created.
4967
4968 2007-06-16  Sergey Poznyakoff  <gray@gnu.org.ua>
4969
4970         * doc/Makefile.am (tar_TEXINFOS): Add tar-snapshot-edit.texi
4971         * doc/tar-snapshot-edit.texi: New file
4972         * doc/tar.texi (Fixing Snapshot Files): New appendix
4973
4974         * scripts/tar-snapshot-edit: New file
4975         * tests/extrac07.at: Add back write permissions on dir
4976
4977 2007-06-09  Sergey Poznyakoff  <gray@gnu.org.ua>
4978
4979         * tests/exclude.at: Sort the output.
4980
4981 2007-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>
4982
4983         * configure.ac, NEWS: Raise version number to 1.17
4984
4985         * doc/tar.texi, doc/intern.texi: Replace: s/filename/file name/;
4986         s/(ASCII|ID|BSD)/@acronym{&}/;s/"[^"]+"/``&''/
4987         Use `path' only when it refers to search paths, use
4988         `file name' otherwise.
4989         Fix various errors (based on patch by Benno Schulenberg)
4990
4991         * doc/tar.texi (Operation Summary): Restore alphabetical order of
4992         the options.
4993
4994 2007-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>
4995
4996         Fix bug, introduced on 2007-03-30.
4997
4998         * src/common.h (xform_type): New data type
4999         (transform_member_name): Last argument is of xform_type type
5000         All callers updated
5001
5002         * src/extract.c: Update calls to transform_member_name
5003         * src/list.c (decode_xform): Exempt symbolic links from component
5004         stripping and name suffix normalization.
5005
5006         * tests/extrac07.at: Update
5007
5008 2007-05-30  Sergey Poznyakoff  <gray@gnu.org.ua>
5009
5010         * src/xheader.c (decx): Unknown pax keywords produce a warning,
5011         not error.
5012
5013 2007-05-29  Paul Eggert  <eggert@cs.ucla.edu>
5014
5015         * src/misc.c (set_file_atime): Use gl_futimens, not futimens,
5016         due to gnulib change.
5017
5018 2007-05-19  Sergey Poznyakoff  <gray@gnu.org.ua>
5019
5020         * src/common.h (buffer_write_global_xheader): New function
5021         (struct xheader): Move definition to tar.h
5022         (extended_header): Remove global
5023         (xheader_init): New function
5024         (xheader_decode_global,xheader_store,xheader_read)
5025         (xheader_write_global,xheader_write,xheader_string_begin)
5026         (xheader_string_add,xheader_string_end): Take xhdr as first
5027         argument.
5028         * src/tar.h (struct xheader): New definition
5029         (struct tar_stat_info): New member xhdr (extended header).
5030
5031         * src/xheader.c (xheader_init): New function
5032         (xheader_decode_global,xheader_store,xheader_read)
5033         (xheader_write_global,xheader_write,xheader_string_begin)
5034         (xheader_string_add,xheader_string_end): Take xhdr as first
5035         argument.
5036
5037         * src/buffer.c (buffer_write_global_xheader): New function
5038         Update to use new xheader calls.
5039
5040         * src/compare.c, src/create.c, src/delete.c, src/list.c,
5041         src/sparse.c, src/tar.c, src/update.c: Global extended_header
5042         removed, use new xheader calls instead.
5043
5044         * tests/T-null.at: Minor fix
5045         * tests/atlocal.in (tarball_prereq): Discard eventual md5sum
5046         output.
5047
5048 2007-05-18  Sergey Poznyakoff  <gray@gnu.org.ua>
5049
5050         * src/create.c (dump_file0): Original ctime cannot be used as a
5051         directory change indicator if --remove-files is given.
5052
5053 2007-04-12  Paul Eggert  <eggert@cs.ucla.edu>
5054
5055         Adjust to latest Gnulib.
5056         * lib/.cvsignore: Add dirfd.c, dirfd.h, float+.h, mbscasecmp.c,
5057         stdio.h, stdio_.h, stdlib.h, stdlib_.h, time.h, time_.h, unistd.h.
5058         Remove exit.h, getcwd.h, mempcpy.h, memrchr.h, mkdtemp.h, stpcpy.h,
5059         strcase.h, strchrnul.h, strdup.h, strndup.h, strnlen.h, time_r.h,
5060         vsnprintf.h.
5061         * m4/.cvsignore: Remove localedir.h.  Sort.
5062
5063 2007-04-03  Paul Eggert  <eggert@cs.ucla.edu>
5064
5065         * src/common.h (closeopen): Remove decl.
5066         * src/misc.c: Don't include <sys/time.h>, <sys/resource.h>; no longer
5067         needed.
5068         (get_max_open_files, closeopen): Remove.  All callers removed.
5069         (chdir_dir): Use a different technique, which doesn't rely on closing
5070         all open files.
5071         * src/tar.c (main): Don't call closeopen.
5072
5073 2007-04-04  Sergey Poznyakoff  <gray@gnu.org.ua>
5074
5075         * NEWS: Update
5076         * doc/tar.texi: Update
5077         * src/system.c (sys_exec_info_script): Store the
5078         inter-communication fd in the environment variable TAR_FD
5079
5080 2007-04-03  Sergey Poznyakoff  <gray@gnu.org.ua>
5081
5082         * src/tar.c (main): Move closeopen after decode_options to
5083         allow shell process substitution to work.
5084         * tests/extrac07.at: Expect a warning on stderr.
5085
5086 2007-03-30  Sergey Poznyakoff  <gray@gnu.org.ua>
5087
5088         * src/common.h (transform_name_fp): Change signature
5089         (transform_member_name): New function
5090         * src/extract.c (extract_link, extract_symlink): Use
5091         transform_member_name instead of safer_name_suffix so that
5092         --transform and --strip-components affect links as well.
5093         * src/list.c (transform_member_name): New function
5094         (decode_header): Use transform_member_name
5095         * src/names.c (all_names_found): Remove check for matching_flags.
5096         * NEWS: Update
5097
5098         * TODO: Update
5099         * bootstrap (slurp): Remove any occurrences of $bt from the
5100         generated gnulib.mk
5101         * src/incremen.c: Do not include mkdtemp.h
5102
5103 2007-01-26  Paul Eggert  <eggert@cs.ucla.edu>
5104
5105         Adjust to recent gnulib changes.
5106         * lib/.cvsignore: Add fchownat.c, rmt-command.h, strerror.c, string.h,
5107         string_.h, sys, sys_time_.h, unistd_.h, wchar_.h, wctype_.h.
5108         Remove localedir.h, size_max.h, xsize.h.
5109         * src/xheader.c: Don't include stpcpy.h; no longer needed, now that
5110         gnulib string.h defines stpcpy on all platforms.
5111
5112 2007-01-23  Sergey Poznyakoff  <gray@gnu.org.ua>
5113
5114         * doc/tar.texi: Document --exclude-caches* and --exclude-tag*
5115         options.
5116         * src/common.h (exclude_caches_option): Remove
5117         (enum exclusion_tag_type): New data type
5118         (add_exclude_tag): Rename to add_exclusion_tag
5119         (cachedir_file_p): New prototype
5120         * src/create.c (struct exclude_tag): rename to exclusion_tag
5121         (check_exclusion_tags): New function
5122         (cachedir_file_p): New function (from check_cache_directory)
5123         (dump_dir0,dump_file0): Use check_exclusion_tags
5124         * src/tar.c: New options --exclude-caches-all,
5125         --exclude-caches-under, --exclude-tag-all, --exclude-tag-under
5126         * tests/exclude.at: New file
5127         * tests/Makefile.am (TESTSUITE_AT): Add exclude.at
5128         * tests/testsuite.at: Add exclude.at
5129
5130 2007-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>
5131
5132         * gnulib.modules: Require strerror
5133         * doc/gendocs_template: Fix typos
5134         * scripts/xsparse.c (expand_sparse): use ftruncate to handle the
5135         trailing hole
5136         * src/sparse.c (sparse_skip_file,pax_dump_header_1)
5137         (pax_decode_header): Keep track of the number of bytes
5138         written.
5139         * configure.ac: Version 1.16.2
5140         * NEWS: Update
5141
5142 2007-01-04  Sergey Poznyakoff  <gray@gnu.org.ua>
5143
5144         * src/compare.c (diff_dumpdir): Compare directory contents using
5145         dumpdir_cmp.  Do not free dumpdir_buffer, it will leave the
5146         incremental directory table in the inconsistent state and trigger
5147         full dump.
5148         (read_and_process): Process dumpdirs no matter what the archive
5149         format.
5150         * src/incremen.c (list_dumpdir): Minor fixes.
5151
5152         * src/compare.c (read_and_process): Fix type of "size"
5153
5154 2006-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>
5155
5156         * tests/T-null.at: Skip the test if genfile is not able to create
5157         the filename with an embedded newline.
5158
5159 2006-12-12  Paul Eggert  <eggert@cs.ucla.edu>
5160
5161         Port to Forte Developer 7 C 5.4 and C99.
5162         * src/common.h (add_exclude_tag): Add decl; C99 requires this
5163         and Forte warns about it.
5164         * src/incremen.c: Include <mkdtemp.h> for mkdtemp prototype,
5165         for same reason.
5166         * src/misc.c (get_max_open_files): Rewrite to avoid code that
5167         Forte C complains about as being unreachable.
5168         * src/xheader.c (mtime_code): Rewrite to avoid Forte error
5169         reported by Trond Hasle Amundsen.
5170
5171         * src/incremen.c (compare_dirnames): Rewrite to avoid casts.
5172         * src/utf8.c (string_ascii_p): Likewise.
5173         * src/xheader.c (mtime_coder, volume_size_coder, volume_offset_coder):
5174         Likewise.
5175
5176 2006-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>
5177
5178         * bootstrap: Add paxutils files to dot_ignore.
5179
5180         * configure.ac: Raise version number to 1.16.1
5181         * bootstrap (slurp): Create .(cvs|git)ignore if not present
5182         * po/.cvsignore, m4/.cvsignore: Remove automatically generated
5183         files.
5184
5185 2006-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>
5186
5187         * NEWS: Update
5188         * Makefile.am (distclean-local): Fixed
5189         * doc/tar.texi: Update documentation of --exclude-tag
5190         * src/create.c (dump_dir0): Move checks for exclude tags to
5191         dump_file0.
5192         (dump_dir): Move calls to ensure_slash to dump_file0
5193         * src/extract.c (extract_file): Call skip_member if open fails.
5194         Patch proposed by Jan-Benedict Glaw <jbglaw@lug-owl.de>
5195         * tests/truncate.at: Use genfile instead of dd, because on some
5196         systems /dev/zero is not available.
5197
5198 2006-12-04  Paul Eggert  <eggert@cs.ucla.edu>
5199
5200         * NEWS: Fix some race conditions with tar -x --same-owner.
5201         * src/extract.c (ARCHIVED_PERMSTATS): Add a comment saying that
5202         S_IRWXG | S_IRWXO might be masked out.
5203         (set_mode): Set the mode if some bits were masked out originally.
5204         (set_stat): Don't chmod before chown, as that might temporarily
5205         grant permissions that we don't want to grant.  The chmod was
5206         there only to work around broken hosts, so add a comment advising
5207         users not to use those broken hosts instead.
5208         (repair_delayed_set_stat, extract_dir):
5209         Remember to mask out current umask before inverting permissions.
5210         (extract_dir): If the owner might change, or if the mode has
5211         special bits, create the directory 700 at first, but restore it later.
5212         (open_output_file): New arg mode; all uses changed.
5213         (extract_file, extract_node, extract_fifo): If the owner might
5214         change, omit group and other bits at first, but restore them after
5215         changing the owner.
5216
5217 2006-12-04  Jim Meyering  <jim@meyering.net>
5218
5219         * doc/tar.texi (Long Options): Remove doubled word.
5220
5221 2006-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>
5222
5223         * src/xheader.c (xheader_read): Remove unused variable
5224
5225         * po/POTFILES.in: Remove src/mangle.c
5226
5227         * bootstrap: Implement --update-po and .bootstrap
5228
5229         * src/create.c (dump_dir0): Implement --exclude-tag option
5230         * src/tar.c: Likewise
5231         * doc/tar.texi (exclude): Document --exclude-tag
5232
5233 2006-11-29  Paul Eggert  <eggert@cs.ucla.edu>
5234
5235         * NEWS: Remove support for mangled names.
5236         * doc/tar.texi (verbose tutorial): Likewise.
5237         * src/Makefile.am (tar_SOURCES): Remove mangle.c.
5238         * src/common.h (extract_mangle): Remove decl.
5239         * src/extract.c (extract_mangle_wrapper): Remove.
5240         (prepare_to_extract): Remove support for mangled names.
5241         * src/list.c (read_and, print_header): Likewise.
5242         * src/mangle.c: Remove.
5243         * src/tar.h (GNUTYPE_NAMES): Remove.
5244
5245         Port to latest gnulib.  There were a lot of changes, so the
5246         simplest way to get this up and running was to switch to coreutils
5247         bootstrap procedure.  I noticed one feature missing after this
5248         merge: the ability to update a single .po file.  I can add that
5249         later if need be.
5250         * README-cvs, bootstrap.conf: New files.
5251         * lib/.cvsignore: Remove Makefile.am, printf-parse.c, vasnprintf.c.
5252         Add fstatat.c, gnulib.mk, openat-proc.c, same-inode.h, stat_.h,
5253         tempname.c, tempname.h, uinttostr.c.
5254         * lib/printf-parse.c, lib/vasnprintf.c: New files, from coreutils,
5255         to override gnulib, so that we don't need xsize.h.
5256         * bootstrap: Replace with coreutils bootstrap, except add support
5257         for paxutils.
5258         * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Remove, as gl_EARLY now
5259         does this.
5260         (gl_EARLY, gl_INIT): Add.
5261         (tar_GNULIB): Remove.
5262         * gnulib.modules: Add configmake.
5263         * lib/Makefile.tmpl: Remove, replacing with....
5264         * lib/Makefile.am: New file.
5265         * src/Makefile.am (tar.o): Remove dependency: Automake does this
5266         for us.
5267         * src/tar.c: Include <configmake.h> and <rmt-command.h>, not
5268         <localedir.h>.
5269
5270 2006-11-13  Sergey Poznyakoff  <gray@gnu.org.ua>
5271
5272         * src/xheader.c (mtime_coder): Treat non-null data as a pointer to
5273         struct timespec, overriding st->mtime
5274         * src/create.c (start_header): Pass mtime as a call-specific data
5275         to xheader_store.
5276
5277         * tests/truncate.at: Do not use 'k' modifier in dd options.
5278         * tests/append02.at: Do not depend on command timing.
5279
5280 2006-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>
5281
5282         * src/tar.c (enum read_file_list_state.file_list_skip): New value
5283         (read_name_from_file): Skip zero-length entries
5284
5285         * tests/T-empty.at: New test case
5286         * tests/T-null.at: New test case
5287         * tests/extrac07.at: New test case
5288         * tests/Makefile.am: Add new test cases.
5289         * tests/testsuite.at: Add new test cases.
5290         * tests/extrac02.at: Add more keywords
5291         * tests/extrac04.at: Likewise
5292         * tests/extrac06.at: Likewise
5293         * tests/shortrec.at: Do not assume tar's default archive is stdout
5294
5295 2006-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>
5296
5297         * src/extract.c, src/xheader.c: Call last_component instead of
5298         base_name. The latter returns a malloced string since 2006-03-11.
5299
5300 2006-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>
5301
5302         * NEWS, configure.ac: Version 1.16
5303         * Makefile.am (distclean-local): New rule
5304
5305 2006-10-17  Sergey Poznyakoff  <gray@gnu.org.ua>
5306
5307         * src/tar.c: Fix help output formatting.  Thanks Benno
5308         Schulenberg.
5309
5310 2006-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>
5311
5312         * Makefile.am (dist-hook): Create a cpio archive.
5313         * NEWS: Update
5314
5315 2006-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>
5316
5317         * doc/tar.texi (Synopsis): Document tar exit codes.
5318         * src/create.c (dump_regular_file,dump_file0): Set exit_status to
5319         TAREXIT_DIFFERS if the file being dumped was truncated or
5320         otherwise changed.
5321         * src/tar.c: Do not attempt to close stderr after call to
5322         close_stdout.
5323         * tests/grow.at: New test case
5324         * tests/Makefile.am: New test grow.at
5325         * tests/testsuite.at: Likewise
5326         * tests/truncate.at (AT_KEYWORDS): Keyword `filechange'
5327         Test tar exit status.
5328
5329         * src/buffer.c (_open_archive): Make sure stdlis is set to stderr
5330         when we are writing archive to stdout (unless --index-file is
5331         used). Bug introduced on 2006-07-06.
5332         * tests/Makefile.am: New test verbose.at
5333         * tests/testsuite.at: Likewise
5334         * tests/indexfile.at (AT_KEYWORDS): Add stdout keyword
5335         * tests/verbose.at: New test case
5336
5337 2006-10-02  Sergey Poznyakoff  <gray@gnu.org.ua>
5338
5339         * THANKS: Add Joerg Weilbier
5340         * src/buffer.c (new_volume): Initialize current_block
5341         * src/xheader.c (xheader_string_end): Fix diagnostic message.
5342         * tests/multiv05.at: New testcase.
5343         * tests/Makefile.am, tests/testsuite.at: Add multiv05.at
5344
5345 2006-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>
5346
5347         * bootstrap: Use ${package} instead of hardcoding package name
5348         * doc/tar.texi: Minor fix
5349         * src/tar.c (doc0, doc1, initialize_argp_doc): Removed.  Rely on
5350         the new argp method instead.
5351
5352 2006-09-12  Sergey Poznyakoff  <gray@gnu.org.ua>
5353
5354         * README: Fix a typo
5355
5356 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
5357
5358         Adjust to latest gnulib.
5359         * lib/.cvsignore: Add at-func.c, configmake.h, fchmodat.c,
5360         fcntl.h, fcntl_.h, inttypes_.h, lstat.c, lstat.h.
5361         * tests/testsuite.at (AT_TAR_MKHIER): Use install-sh -d
5362         rather than the no-longer-included mkinstalldirs.
5363
5364 2006-09-08  Sergey Poznyakoff  <gray@gnu.org.ua>
5365
5366         * src/incremen.c (try_purge_directory): Initialize struct st.  Fix
5367         condition for selecting candidates for removal.
5368         * README-alpha: List texinfo among build prerequisites for the CVS
5369         version.
5370
5371         * bootstrap (intl_files_to_remove): Do not remove m4/inttypes-h.m4
5372         and m4/inttypes-pri.m4
5373
5374 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
5375
5376         * bootstrap: Set XGETTEXT_OPTIONS to flag our printf-format functions,
5377         so that translators are warned about strings that are formats but
5378         don't look like formats.  This might help prevent core dumps.
5379         * configure.ac (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros.
5380         Suggested by Eric Blake to avoid problems like
5381         <http://lists.gnu.org/archive/html/bug-coreutils/2006-07/msg00087.html>.
5382         (AM_GNU_GETTEXT_VERSION): Upgrade from 0.12.1 to 0.15.  The gettext
5383         manual says we should use the version number normally expected of
5384         maintainers, neither more nor less.
5385
5386         * bootstrap (get_translations):
5387         Don't exclude ky.po; it is working again.
5388
5389 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
5390
5391         * bootstrap (get_translations):
5392         Don't exclude ja.po; it is working again.
5393         Don't remove all old .po files if we're merely updating one.
5394         * po/.cvsignore: Add Makevars.
5395
5396 2006-08-07  Paul Eggert  <eggert@cs.ucla.edu>
5397
5398         * src/tar.c: Work around limitation imposed by gettext 0.15
5399         by concatenating strings with "\v" after translation.
5400         (doc): Remove, splitting into:
5401         (doc0, doc1): New constants.
5402         (argp): Don't use doc; just initialize to NULL.
5403         (initialize_argp_doc): New function.
5404         (decode_options): Use it.
5405
5406         * bootstrap: Redo po file retrieval to match Bison's method,
5407         since the translation project changed its index format.
5408         Don't use --assume-autoconf; it's now replaced
5409         by looking in configure.ac.
5410         (m4/codeset.m4, m4/intdiv.m4, m4/inttypes-pri.m4, m4/isc-posix.m4):
5411         (m4/lcmessage.m4, m4/onceonly_2_57.m4, m4/gettext.m4, m4/glibc21.m4):
5412         (m4/inttypes_h.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4):
5413         (m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4):
5414         Don't rename to ..._gl.m4, as this is no longer needed.
5415         (m4/geteext.m4): Patch to remove the need for intl/*.
5416         Use autopoint manually, then remove the intl files,
5417         then undo changes to gnulib files that autoreconf made,
5418         and then run aclocal/autoconf/autoheader/automake.
5419         This makes our bootstrap procedure closer to Bison's.
5420         (po/Makevars): Generate automatically.
5421         * configure.ac (AC_PREREQ): Update from 2.59 to 2.60.
5422         (gl_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Remove.
5423         * gnulib.modules: Add inttypes, stdint.
5424         * lib/.cvsignore: Add close-stream.c, close-stream.h,
5425         stdint.h, stdint_.h.
5426         * po/Makefile: Remove; now automatically generated.
5427
5428         * src/incremen.c (read_incr_db_01): Check input strings more
5429         carefully.  Do not pass arbitrary char values to isspace, as
5430         this has undefined behavior.  Likewise for assigning arbitrary
5431         uintmax_t values to other types.
5432         (read_negative_num, read_unsigned_num, read_timespec):
5433         New functions, to check input values a bit more carefully.
5434         (read_num): Use read_unsigned_num.  New arg MAX_VAL;
5435         all callers changed.
5436         (read_incr_db_2): Use these new functions.
5437         Use a consistent diagnostic for unexpected EOF.
5438         (read_directory_file): Do not assign arbitrary uintmax_t value
5439         to int.
5440         (read_timespec, write_directory_file_entry, write_directory_file):
5441         Handle negative time_t values correctly.  We don't bother to do
5442         this with pre-2 formats, since presumably the time stamps were
5443         output incorrectly.
5444
5445         * src/tar.c (doc): Don't use \v in an argument to gettext;
5446         gettext 0.15 rejects this.
5447
5448 2006-07-24  Sergey Poznyakoff  <gray@gnu.org.ua>
5449
5450         * src/tar.c (decode_options): Do not require -L with -M -Hpax.
5451         It could be needed in future, but currently it is not.
5452         * src/create.c (to_chars_subst): Update comment regarding OLDGNU
5453         vs. GNU format differences.
5454         (mode_to_chars): Treat OLDGNU_FORMAT same as GNU_FORMAT. Fixes bug
5455         reported by TAMUKI Shoichi <tamuki@linet.gr.jp>, which caused
5456         equivalent `tar cf ...' and `tar rf ...' commands to produce
5457         different archives.
5458
5459         * tests/append02.at: New test case
5460         * tests/Makefile.am, tests/testsuite.at: Add append02.at
5461
5462 2006-07-20  Paul Eggert  <eggert@cs.ucla.edu>
5463
5464         * bootstrap: Adjust to today's change to gnulib-tool by invoking
5465         it with --assume-autoconf='latest-stable'.
5466
5467 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
5468
5469         Adjust to recent gnulib changes.
5470         * lib/.cvsignore: Remove atexit.c, exit.c, getndelim2.c, getndelim2.h,
5471         pathmax.h, paxconvert.c, paxerror.h, xstrdup.c.
5472         Add inttypes.h, mktime.c, wcwidth.h, xstrndup.c, xstrndup.h.
5473         * src/create.c (start_header): Adjust to API change to mode_adjust.
5474
5475 2006-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>
5476
5477         * THANKS: Add Ralf Wildenhues
5478         * NEWS: Update
5479
5480 2006-07-09  Ralf Wildenhues   <Ralf.Wildenhues@gmx.de>
5481
5482         * doc/dumpdir.texi, doc/snapshot.texi, doc/sparse.texi,
5483         doc/tar.texi: Fix some typos.
5484
5485 2006-07-06  Sergey Poznyakoff  <gray@gnu.org.ua>
5486
5487         tar --index-file=FILE --file=- sent the archive to FILE, and
5488         the listing to stderr. Bug reported by Marcin Gryszkalis
5489         <mg@fork.pl>
5490
5491         * src/buffer.c (_open_archive): Remove stdlis initialization
5492         * src/tar.c (decode_options): Initialize stdlis
5493         * tests/indexfile.at: New test case
5494         * tests/testsuite.at: Include indexfile.at
5495         * tests/Makefile.am (TESTSUITE_AT): Add indexfile.at
5496
5497 2006-07-05  Sergey Poznyakoff  <gray@gnu.org.ua>
5498
5499         * doc/Makefile.am (manual): Fix TEXINPUTS
5500         * doc/rendition.texi (FIXME): Do not use deprecated @quote-args.
5501         Do not use @allow-recursion. In its current form the macro is not
5502         recursive.
5503
5504 2006-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>
5505
5506         * bootstrap (update_po): Fix single translation update
5507
5508 2006-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>
5509
5510         * configure.ac (AC_CHECK_FUNCS): Check for getdtablesize
5511         * src/common.h (closeopen): New function
5512         * src/misc.c (chdir_arg): Use x2nrealloc to reallocate wd.
5513         (get_max_open_files,closeopen): New functions
5514         (chdir_do): Do not use save_cwd if it was already used more than
5515         max_open_files-4 times to avoid running off the file
5516         descriptors.
5517         * src/tar.c (main): Call closeopen
5518         * doc/tar.texi: Update --directory description
5519         * NEWS: Update
5520
5521 2006-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>
5522
5523         * doc/tar.texi: Update. Add cross-references.
5524         * doc/sparse.texi: Add cross-references.
5525
5526 2006-06-25  Sergey Poznyakoff  <gray@gnu.org.ua>
5527
5528         * scripts/xsparse.c: A sample utility to expand sparse files
5529         extracted by third-party tars. It is not meant to be installed nor
5530         to be included in the distribution. It is here, so that it can be
5531         obtained either from CVS or from the tar web site.
5532         * doc/Makefile.am (tar_TEXINFOS): Sorted
5533         * doc/tar.texi (Other Tars): New node describing how to extract
5534         GNU-specific member formats using third-party tars.
5535         * src/common.h (sparse_file_p): Remove
5536         * src/sparse.c: Likewise
5537         * src/create.c: Use ST_IS_SPARSE instead of sparse_file_p (update
5538         paxutils first)
5539         * src/tar.c: --sparse-version turns on --sparse
5540
5541 2006-06-24  Sergey Poznyakoff  <gray@gnu.org.ua>
5542
5543         * src/buffer.c (print_total_stats): Add default case.
5544         * src/common.h (name_init): New prototype.
5545         (xheader_string_end): Return bool.
5546         * src/extract.c (extract_volhdr): Add missing return
5547         * src/incremen.c: Remove not used variables
5548         * src/sparse.c (pax_dump_header_0): Return false if
5549         xheader_string_end fails (for 0.1 formats).
5550         (pax_dump_header): Return meaningful value
5551         * src/transform.c (segm_count): Change type to size_t
5552         * src/xheader.c (xhdr_tab.decoder): pass keyword as a second
5553         argument. All callers changed.
5554         (decode_record): Check for numeric overflow
5555         (xheader_string_end): Return boolean value. Check for possible
5556         numeric overflow
5557
5558 2006-06-23  Sergey Poznyakoff  <gray@gnu.org.ua>
5559
5560         * doc/sparse.texi: New file
5561         * doc/Makefile.am (tar_TEXINFOS): Add sparse.texi
5562         * doc/intern.texi (Sparse Formats): New node
5563         * doc/tar.texi: Update master menu
5564
5565         * src/common.h (tar_sparse_major,tar_sparse_minor): New globals.
5566         * src/sparse.c: Implement sparse format versioning. Implement new
5567         version (1.0) of PAX sparse format.
5568         (pax_sparse_member_p): Fix condition
5569         (pax_dump_header): A dispatcher function
5570         (pax_dump_header_0,pax_dump_header_1): New functions.
5571         (pax_optab): Update
5572         (oldgnu_dump_header): Minor fix: make sure
5573         sparse_header.isextended is set before calling
5574         set_next_block_after
5575         * src/tar.c: New option --sparse-version
5576         * src/tar.h (struct tar_stat_info.sparse_major,sparse_minor): New
5577         members.
5578         * src/xheader.c: Implement new keywords: GNU.sparse.name,
5579         GNU.sparse.major, GNU.sparse.minor, GNU.sparse.realsize
5580
5581         * tests/spmpv00.at, tests/spmvp01.at, tests/spmvp10.at: New
5582         testcases.
5583
5584         * tests/Makefile.am: Add spmvp00.at, spmpv01.at, spmpv10.at
5585         * tests/shortrec.at: Explicitely give `-f -' to the tar invocation
5586         * tests/sparsemvp.at: Rewritten as an include file.
5587         (TAR_MVP_TEST): New macro
5588         * tests/testsuite.at: Include sparsemvp.at, spmvp00.at,
5589         spmvp01.at, spmvp10.at
5590
5591 2006-06-21  Sergey Poznyakoff  <gray@gnu.org.ua>
5592
5593         * doc/tar.texi (Overriding File Metadata): New node
5594         Document --mtime option.
5595         * src/common.h (set_mtime_option,mtime_option): New globals
5596         * src/create.c (start_header): Override mtime if requested
5597         * src/tar.c: Implement new option, --mtime, allowing to set
5598         modification times for all archive members during creation.
5599         (struct tar_args): textual_date_option replaced with a linked list
5600         textual_date. All references updated.
5601         (get_date_or_file,report_textual_dates): New functions.
5602         * configure.ac: Raise version number to 1.15.92
5603         * NEWS: Update
5604
5605 2006-06-20  Sergey Poznyakoff  <gray@gnu.org.ua>
5606
5607         * src/common.h (struct name.explicit): Remove
5608         Use variable names in all declarations
5609         (name_scan): Remove second argument
5610         * src/delete.c: Remove second argument from calls to name_scan
5611         * src/update.c: Likewise
5612         * src/incremen.c (procdir): Use is_individual_file to check for
5613         files explicitly specified in the command line. Fixes bug
5614         reported by Dat Head on 19 Jun 2006 (descending into mountpoints
5615         with --one-file-system in use)
5616         * src/misc.c (maybe_backup_file): Second argument is bool
5617         * src/names.c (name_next_elt): Call register_individual_file
5618         (namelist_match): Remove third argument
5619         (name_match): Change return type to bool
5620         (name_scan): Remove second argument
5621         * src/sparse.c (pax_dump_header): Store original sparse file name
5622         in GNU.sparse.name variable. The name field in the ustar header
5623         now contains generated name (%d/GNUSparseFile.%p/%f), so that
5624         non-pax-aware tars won't extract the file under the original
5625         filename.
5626         * src/xheader.c (GNU.sparse.name): New variable for storing sparse
5627         file name.
5628
5629 2006-06-13  Sergey Poznyakoff  <gray@gnu.org.ua>
5630
5631         * doc/Makefile.am (check-options): Expand macros before grepping
5632         in $(info_TEXINFOS)
5633         * doc/rendition.texi (FIXME) [!PROOF_FOOTNOTED]: Enclose in a
5634         cartouche
5635         * doc/tar.texi: Define op as codeindex. Use special macros to
5636         populate it
5637         Consequently prefer @dfn{long options} over @dfn{mnemonic
5638         options}.
5639         Document --unquote, --no-unquote
5640         (Short Option Summary): Build a table of cross-references to the
5641         corresponding long options.
5642         (Using Multiple Tapes,Multi-Volume Archives): Rewritten
5643
5644         * doc/value.texi (xopindex,opsummary): New macros
5645
5646         * doc/Makefile.am (check-options): New goal
5647         * doc/tar.texi: Update
5648         * src/tar.c: Implement --overwrite-dir option (long ago
5649         documented).
5650
5651 2006-06-12  Sergey Poznyakoff  <gray@gnu.org.ua>
5652
5653         * doc/tar.texi: Document better the --totals option
5654         * NEWS: Update
5655         * src/buffer.c (total_blocks_deleted): New variable
5656         (set_start_time): Set volume_start_time and last_stat_time as well
5657         (set_volume_start_time): New function
5658         (compute_duration): Do not call set_start_time, update
5659         last_stat_time instead. Use it in calculation instead of
5660         start_time, which is now set only once, upon startup.
5661         (print_total_written): Removed.
5662         (print_total_stats): New function for printing byte/speed statistics.
5663         (_open_archive): Detect attempts to update compressed archives.
5664         (_gnu_flush_write): Always update prev_written.
5665         (open_archive): Call set_volume_start_time.
5666         * src/common.h (volume_start_time,last_stat_time): New globals
5667         (print_total_written): Replaced with:
5668         (print_total_stats): New function
5669         * src/delete.c (records_skipped): Remove static qualifier, the
5670         variable is used by print_total_stats in buffer.c
5671         * src/extract.c (check_time): Use volume_start_time when checking
5672         for timestamp plausibility.
5673         * src/tar.c: (options, parse_opt): Allow for optional argument to
5674         the --totals option, which specifies a signal upon delivery of which
5675         the statistics must be output.
5676         (main): Call print_total_stats if total_option is set.
5677
5678 2006-06-11  Sergey Poznyakoff  <gray@gnu.org.ua>
5679
5680         * src/xheader.c (xheader_set_single_keyword): Fix typo.
5681         (decode_time): Avoid using gotos.
5682
5683         * doc/mastermenu.el: New file
5684         * doc/Makefile.am (master-menu): New goal
5685         * doc/tar.texi: Update master menu
5686
5687 2006-06-10  Sergey Poznyakoff  <gray@gnu.org.ua>
5688
5689         * doc/tar.texi: Remove leftover include
5690
5691 2006-06-09  Sergey Poznyakoff  <gray@gnu.org.ua>
5692
5693         * doc/Makefile.am (tar_TEXINFOS): Add intern.texi
5694         (EXTRA_DIST): Remove convtexi.pl, add texify.sed
5695         * doc/intern.texi: New file
5696         * doc/convtexi.pl: Remove
5697         * doc/texify.sed: Auxiliary script to convert ../src/tar.h to
5698         header.texi
5699         * doc/rendition.texi: Fix typo
5700         * doc/tar.texi: Update
5701         * src/tar.h: Fix indentation, introduce end-of-format marker for
5702         texify.sed
5703
5704         * THANKS: Add Jason Armistead
5705         * doc/tar.texi: Update
5706         * NEWS: Update
5707         * src/buffer.c: Implement more flexible checkpoint style
5708         * src/common.h (checkpoint_option): Change type to unsigned
5709         (checkpoint_style): New variable.
5710         * src/tar.c: --checkpoint takes an optional argument specifying
5711         number of records between two successive checkpoints (proposed
5712         by Jason Armistead on 2004-06-22).  Optional dot starting the
5713         argument means "print dots instead of textual checkpoints".
5714         (tar_help): New function
5715         * src/transform.c: Minor fixes.
5716
5717 2006-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>
5718
5719         * gnulib.modules: Add mkdtemp
5720         * doc/dumpdir.texi: New file
5721         * doc/Makefile.am (tar_TEXINFOS): Add dumpdir.texi
5722         * doc/tar.texi: Document dumpdir format
5723         * src/incremen.c (dumpdir_locate,obstack_code_rename):
5724         (purge_directory): Re-implement renaming. Introduce
5725         'X' control code.
5726         (make_tmp_dir_name): Remove
5727
5728         * src/transform.c (set_transform_expr,_transform_name_to_obstack):
5729         Implement NUMBER flag.
5730         (add_char_segment): Fix length assignment
5731
5732         * doc/tar.texi: Update
5733
5734 2006-06-07  Sergey Poznyakoff  <gray@gnu.org.ua>
5735
5736         * src/transform.c (transform_name_fp): Run fun even if
5737         _transform_name_to_obstack returns false.
5738         (_transform_name_to_obstack,set_transform_expr): Implement GNU
5739         extension case conversion operations.
5740
5741         * doc/tar.texi (transform): Document the option.
5742
5743 2006-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>
5744
5745         * NEWS: Update
5746         * src/common.h (set_transform_expr): New function
5747         * tests/Makefile.am: Add incr04.at
5748         * tests/testsuite.at: Likewise
5749         * tests/incr04.at: New test case
5750         * tests/long01.at: Fix typo in the comment
5751         * tests/multiv04.at: Use genfile --files-from
5752
5753         (Above changes need new genfile.c from paxutils)
5754
5755         * TODO: Update
5756         * NEWS: Update
5757         * doc/tar.texi: Update
5758         * src/transform.c: New file
5759         * src/Makefile.am (tar_SOURCES): New module transform.c
5760         * src/common.h (transform_name, transform_name_fp): New functions
5761         (show_stored_names_option): Renamed to
5762         show_transformed_names_option. All uses changed
5763         * src/create.c (dump_file0): Transform file name
5764         * src/extract.c (extract_archive): safer_name_suffix and
5765         stripped_prefix_len are now called by decode_header
5766         * src/list.c (print_header): Update displayable name selection.
5767         * src/tar.c: New option --transform
5768         New option --show-transformed-names generalizes
5769         --show-stored-names. The latter is retained as an alias.
5770
5771 2006-05-31  Sergey Poznyakoff  <gray@gnu.org.ua>
5772
5773         * src/incremen.c (make_directory): Fix initialization of struct
5774         directory.
5775
5776 2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
5777
5778         * doc/tar.texi: Document use of globbing patterns.
5779         * src/tar.c (parse_opt): Add comment before --preserve case.
5780
5781 2006-05-24  Sergey Poznyakoff  <gray@gnu.org.ua>
5782
5783         * NEWS: Update
5784         * doc/tar.texi: Update
5785         * configure.ac (AM_INIT_AUTOMAKE): Use tar-ustar option. Raise
5786         version requirement to 1.9
5787         * src/common.h (struct name): Refactored
5788         (warn_regex_usage): New variable.
5789         (dump_file): First argument is const char*.
5790         (name_init,name_add): Removed
5791         (name_add_name,name_add_dir): New functions
5792         (name_next): Return const char*.
5793         * src/create.c: (dump_file,dump_file0): First argument is const
5794         char*. All callers updated.
5795         * src/names.c: Rewritten handling of member names in the command
5796         line. Tar no longer attempts to guess globbing patterns, instead
5797         it relies on --wildcard option.
5798         (init_names): Removed.
5799         (struct name_elt): New structure.
5800         (name_array): Change type to struct name_elt. All references updated
5801         (name_add_name,name_add_dir): New functions
5802         (name_next_elt): New function
5803         (name_next): Rewritten using name_next_elt.
5804         (namelist_match): Rewritten pattern matching using
5805         exclude_fnmatch.
5806         (names_notfound): Warn if globbing patterns were used without
5807         --wildcards option
5808         * src/tar.c (options): Move globbing-related options into a
5809         separate group. Set -l as an alias to --check-links, as required
5810         by UNIX98
5811         (struct tar_args): New fields
5812         wildcards,matching_flags,include_anchored
5813         (MAKE_EXCL_OPTIONS,MAKE_INCL_OPTIONS): New macros
5814         (parse_opt): Use x2nrealloc to grow archive_name_array.
5815         Use MAKE_EXCL_OPTIONS,MAKE_INCL_OPTIONS to create appropriate
5816         fnmatch options, and name_add_name,name_add_dir to handle member
5817         name and -C arguments.
5818         (decode_options): Likewise
5819         (main): Remove call to init_names.
5820
5821         * tests/append.at, tests/append01.at, tests/extrac01.at,
5822         tests/options.at, tests/options02.at, tests/same-order01.at,
5823         tests/same-order02.at: Make AT_SETUP more readable.
5824
5825 2006-05-23  Sergey Poznyakoff  <gray@gnu.org.ua>
5826
5827         * src/buffer.c (change_tape_menu): Fix typo (uninitialized
5828         variable) introduced yesterday.
5829
5830 2006-05-22  Sergey Poznyakoff  <gray@gnu.org.ua>
5831
5832         * doc/tar.texi: Use @var{file_name} instead of @var{file name}
5833         * src/buffer.c (change_tape_menu): Break the loop after obtaining
5834         new archive name. Check for empty input line.
5835
5836 2006-05-15  Sergey Poznyakoff  <gray@gnu.org.ua>
5837
5838         * tests/atlocal.in (XFAILFILE): New variable
5839         * tests/version.at: Create $XFAILFILE on failure
5840         * tests/testsuite.at (AT_TAR_CHECK): Declare expected failure if
5841         $XFAILFILE exists.
5842
5843 2006-05-13  Sergey Poznyakoff  <gray@gnu.org.ua>
5844
5845         * THANKS: Update
5846         * src/buffer.c (read_header0): Use read_header_primitive to avoid
5847         clubbering current_tar_info. All callers updated.
5848         * src/common.h (read_header_primitive): New function
5849         * src/extract.c (extract_volhdr): New function
5850         (prepare_to_extract): Use extract_volhdr as extractor for volume
5851         names.
5852         * src/list.c (read_header_primitive): New function
5853         (read_header): Front end for read_header_primitive
5854         * tests/chtype.at: New file
5855         * tests/volsize.at: New file
5856         * tests/Makefile.am (TESTSUITE_AT): Add chtype.at, volsize.at
5857         (check-full): New target.
5858         * tests/atlocal.in (TEST_DATA_URL,STAR_DATA_URL)
5859         (STAR_TESTSCRIPTS): Provide default values.
5860         (tarball_prereq): New function
5861         * tests/testsuite.at (AT_TARBALL_PREREQ): New defun
5862         (AT_STAR_PREREQ): Rewrite using tarball_prereq
5863         Include chtype.at and volsize.at
5864         * tests/volume.at: Add keywords.
5865
5866         * tests/star/gtarfail.at, tests/star/gtarfail2.at,
5867         tests/star/multi-fail.at, tests/star/pax-big-10g.at,
5868         tests/star/ustar-big-2g.at, tests/star/ustar-big-8g.at
5869         (AT_STAR_PREREQ): Provide md5 sum.
5870
5871         * lib/.cvsignore: Update
5872
5873 2006-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>
5874
5875         * tests/testsuite.at (AT_SORT_PREREQ, AT_UNPRIVILEGED_PREREQ): New
5876         defines
5877
5878         * tests/extrac04.at, tests/incr03.at, tests/listed02.at,
5879         tests/pipe.at, tests/rename01.at, tests/rename02.at,
5880         tests/rename03.at, tests/same-order01.at: Call
5881         AT_SORT_PREREQ. Remove fd 2 redirection after calls to sort
5882         * ignfail.at: Call AT_UNPRIVILEGED_PREREQ
5883
5884 2006-05-08  Sergey Poznyakoff  <gray@gnu.org.ua>
5885
5886         Listed incremental backups: keep more information about
5887         directories. Handle renamed directories more effectively
5888         (initial implementation, more updates to follow).
5889         Source tree before this point is tagged
5890         alpha_1_15_90_incremental_1.
5891
5892         * NEWS: Update
5893         * configure.ac: Raise version number to 1.15.91
5894         * src/common.h (rename_directory,append_incremental_renames): New
5895         functions.
5896         * src/extract.c (rename_directory): New function
5897         * src/incremen.c (struct directory.contents, flags): New members
5898         (nfs,found,new): Remove. Replaced by appropriate bitmask values in
5899         `flags' field. All uses updated.
5900         (directory_meta_table): New table.
5901         (hash_directory): Rename to hash_directory_name
5902         (compare_directories): Rename to compare_directory_names
5903         (hash_directory_meta,compare_directory_meta,find_directory_meta):
5904         New functions
5905         (compare_dirents): Removed
5906         (note_directory): Get 7th argument: directory contents.
5907         All callers updated
5908         (dumpdir_locate,makedumpdir): New functions
5909         (scan_directory): Rewritten. Use makedumpdir to create a sorted
5910         dumpdir array. This makes the obstack argument unnecessary. Besides,
5911         ALL_CHILDREN flag is set only for new directories.
5912         (procdir): Change return type to struct directory. Return
5913         immediately if the directory was already initialized. Discover
5914         directory renames using directory_meta_table.
5915         (append_incremental_renames): New function.
5916         (read_directory_file, write_directory_file): Use new snapshot file
5917         format.
5918         * src/names.c (collect_and_sort_names): Update dir_contents of the
5919         first non-fake name entry when in listed incremental mode.
5920
5921         * tests/incr03.at: New testcase
5922         * tests/rename01.at: New testcase
5923         * tests/rename02.at: New testcase
5924         * tests/rename03.at: New testcase
5925         * tests/Makefile.am: Add
5926         incr03.at,rename01.at,rename02.at,rename03.at
5927         * tests/testsuite.at: Likewise.
5928         * tests/listed02.at: Update for the new behavior
5929         * tests/multiv04.at (AT_KEYWORDS): Add missing incremental kw.
5930
5931 2006-05-02  Sergey Poznyakoff  <gray@gnu.org.ua>
5932
5933         * src/buffer.c (try_new_volume): Attempt to continue if the name
5934         is apparently truncated in a GNU format volume.
5935
5936         * tests/comprec.at, tests/delete01.at, tests/delete02.at,
5937         tests/delete04.at, tests/delete05.at, tests/extrac05.at,
5938         tests/listed01.at, tests/multiv01.at, tests/multiv02.at,
5939         tests/pipe.at, tests/same-order01.at, tests/same-order02.at,
5940         tests/sparse01.at, tests/sparse03.at: Always use genfile --file,
5941         this enables extra error checking.
5942
5943         * tests/multiv03.at: Attempt to extract a member with truncated
5944         file name from the archive.
5945
5946         * src/buffer.c (_open_archive): Remove unnecessary argument to
5947         check_compressed_archive.
5948
5949 2006-04-25  Sergey Poznyakoff  <gray@gnu.org.ua>
5950
5951         * tests/sparse01.at, tests/sparse02.at, tests/sparse03.at,
5952         tests/sparsemv.at, tests/sparsemvp.at: Skip the test if the file
5953         system does not support sparse files.
5954         * doc/tar.texi (@copying): Remove the reference to not existing
5955         invariant section.
5956
5957 2006-04-11  Sergey Poznyakoff  <gray@gnu.org.ua>
5958
5959         * src/extract.c (extract_dir): Fix toggling existing directory
5960         permissions (Debian bug #361077). Use parts of patch provided by
5961         Ian Jackson <iwj@ubuntu.com>.
5962         * src/compare.c: Minor changes
5963         * src/incremen.c (directory.new): New member
5964         (note_directory,find_directory: Use make_directory to create
5965         struct directory entries
5966         (procdir): Avoid duplicating  directories in the incremental
5967         backup map.
5968         * tests/Makefile.am (TESTSUITE_AT): Add extrac06.at
5969         * tests/testsuite.at: Include extrac06.at
5970
5971 2006-03-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de> (trivial change)
5972
5973         * tests/atlocal.in (PATH): Add build-aux from the source tree,
5974         not the build tree.
5975
5976 2006-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>
5977
5978         * THANKS: Add Benno Schulenberg
5979
5980 2006-03-13  Jim Meyering <jim@meyering.net>
5981
5982         * tests/listed02.at:  Sort the two lines of stderr from the
5983         first `tar -v --listed-incremental'.  They would come out
5984         reversed and provoke a test failure on a tmpfs
5985         file system.
5986
5987 2006-03-13  Benno Schulenberg <benno@nietvergeten.nl>
5988
5989         * doc/tar.texi: Minor fixes.
5990         * src/tar.c (options): Consistently begin help messages with a
5991         lowercase letter.
5992
5993 2006-03-12  Sergey Poznyakoff  <gray@gnu.org.ua>
5994
5995         * tests/Makefile.am (AM_CPPFLAGS): Define LOCALEDIR
5996
5997 2006-03-07  Paul Eggert  <eggert@cs.ucla.edu>
5998
5999         * src/buffer.c (record_buffer_aligned): New var.
6000         (init_buffer): Use it to ensure that the buffer is aligned.
6001         This doesn't result in any measurable performance improvement
6002         on my host (Debian GNU/Linux 3.1 stable, with default block size),
6003         but I assume it does help on some hosts.
6004
6005         * lib/.cvsignore: Sort.
6006
6007 2006-03-04  Sergey Poznyakoff  <gray@gnu.org.ua>
6008
6009         * tests/shortrec.at: Use -f - to read from stdin.
6010
6011 2006-02-21  Sergey Poznyakoff  <gray@gnu.org.ua>
6012
6013         * doc/tar.texi: Fix typo: --to-command instead of --to-program
6014
6015 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
6016
6017         * tests/multiv04.at (split directory members in a MV archive):
6018         Don't use %X in an awk printf format; this doesn't work with
6019         Solaris 10 /usr/bin/awk.  Use %x instead.
6020
6021 2006-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>
6022
6023         * src/create.c (split_long_name): Fix maximum length estimation.
6024         Patch by Jim Lowe.
6025         * tests/Makefile.am (lustar01.at,lustar02.at,lustar03.at): New
6026         tests.
6027         * tests/atlocal.in: Add build-aux to the PATH
6028         * tests/long01.at: Remove mkhier, use AT_TAR_MKHIER instead
6029         * tests/longv7.at: Reword test title
6030         * tests/lustar01.at: New test
6031         * tests/lustar02.at: New test
6032         * tests/lustar03.at: New test
6033         * tests/testsuite.at (AT_TAR_MKHIER): New macro
6034         (lustar01.at,lustar02.at,lustar03.at): New tests.
6035
6036 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
6037
6038         * bootstrap: Don't claim lib/Makefile.am is generated automatically
6039         from itself.
6040
6041         Avoid installation glitches on Solaris 8 with Sun C 5.4.
6042         * lib/.cvsignore: Add system-ioctl.h.
6043         * lib/Makefile.tmpl (noinst_HEADERS): Add system-ioctl.h.
6044         * src/buffer.c: Include system-ioctl.h.
6045         * src/compare.c: Likewise.
6046         * src/delete.c: Likewise.
6047         * src/system.c: Include <getline.h>, <setenv.h>.
6048         * src/tar.c: Include <getline.h>.
6049
6050 2006-02-19  Sergey Poznyakoff  <gray@gnu.org.ua>
6051
6052         * src/buffer.c (add_chunk_header): Free st.orig_file_name after
6053         calling finish_header().
6054         (new_volume): Prompt the user for archive name if unable to open
6055         next archive.
6056
6057         * src/create.c (dump_file0): Restore file_count_links,
6058         accidentally removed on 2005-11-29.
6059         * configure.ac: Raise version number to 1.15.90
6060         * NEWS: Likewise.
6061
6062 2006-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>
6063
6064         * src/tar.c (tar_set_quoting_style): Provide second argument to
6065         the format spec: program_invocation_short_name. Reported by Jim
6066         Meyering.
6067
6068 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
6069
6070         * gnulib.modules: Add closeout, exitfial.
6071         * lib/.cvsignore: Add __fpending.c, __fpending.h, closeout.c,
6072         closeout.h.
6073         * src/buffer.c: Incluse closeout.h.
6074         (_open_archive): Use freopen rather than fopen, so
6075         that stdlis is always either stdout or stderr.  Use
6076         close_stdout_set_file_name to report its name.
6077         * src/tar.c: Include closeout.h and exitfail.h.
6078         (parse_opt, usage): Call close_stdout as appropriate, to check for
6079         write errors.
6080         (decode_options): Exit with status TAREXIT_FAILURE, not 1.
6081         (main): Set exit_failure, to exit with proper status on memory
6082         allocation failure and the like.
6083         Use close_stdout rather than rolling our own test.
6084
6085         * NEWS: --version now outputs copyright etc., to conform to the
6086         GNU coding standards.  Remove --license.
6087         * gnulib.modules: Add version-etc-fsf.
6088         * doc/tar.texi: Document the change.
6089         * lib/.cvsignore: Add version-etc-fsf.c, version-etc.c, version-etc.h.
6090         * scripts/Makefile.am (SED_CMD): Update PAKCAGE_NAME, not PACKAGE.
6091         * scripts/backup.in: Remove --license.  Change --version to conform
6092         to GCS.
6093         * scripts/restore.in: Likewise.
6094         * scripts/backup.sh.in (license): Output briefer license in the
6095         style of coreutils, for consistency with other changes.
6096         * src/tar.c: Include <version-etc.h>.
6097         (LICENSE_OPTION): Remove.
6098         (options): Remove --license.
6099         (license): Remove.
6100         (parse_opt): Use version_etc instead of rolling it ourselves.
6101         Remove --license.
6102         * tests/version.at (tar --version): Check only the first line of
6103         output.
6104
6105         * ChangeLog, NEWS, src/common.h, src/extract.c, src/incremen.c:
6106         * src/list.c, src/names.c, src/tar.h, src/xheader.c:
6107         Update copyright year to 2006.
6108
6109 2006-02-07  Jim Meyering  <jim@meyering.net>
6110
6111         * src/xheader.c (sparse_map_decoder): Fix misleading diagnostic.
6112
6113 2006-01-31  Sergey Poznyakoff  <gray@gnu.org.ua>
6114
6115         * src/common.h (get_gnu_dumpdir): Remove prototype
6116         (is_dumpdir): New function
6117         * src/extract.c (prepare_to_extract): Use is_dumpdir member to
6118         check for dumpdirs.
6119         * src/incremen.c (get_gnu_dumpdir): Static
6120         (is_dumpdir): New function
6121         (purge_directory): Use is_dumpdir
6122         * src/list.c (list_archive): Use is_dumpdir
6123         Do not wrap skip_member in mv_begin/mv_end, the function itself
6124         takes care of it.
6125         (decode_header): Set stat_info->is_dumpdir
6126         (skip_member): Do nothing if skipped is true
6127         * src/tar.h (struct tar_stat_info): New members is_dumpdir and skipped.
6128
6129 2006-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>
6130
6131         * src/tar.c (decode_options): Refuse using --delete with
6132         compression options.
6133
6134 2006-01-18  Sergey Poznyakoff  <gray@gnu.org.ua>
6135
6136         * NEWS: Updated.
6137         * configure.ac (DEFAULT_QUOTING_STYLE): New configuration variable
6138         * doc/tar.texi: Initial documentation for --quoting-style,
6139         --quote-chars and --no-quote-chars option.
6140         * src/tar.c: Implement new options --quoting-style, --quote-chars
6141         and --no-quote-chars.
6142
6143 2006-01-09  Paul Eggert  <eggert@cs.ucla.edu>
6144
6145         * bootstrap: Default to pserver, and switch to cvs.sv.gnu.org,
6146         to accommodate recent changes to the GNU CVS server.
6147         * lib/.cvsignore: Add argp-pin.c, mkdirat.c, openat-priv.h.
6148
6149 2005-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>
6150
6151         * src/names.c (name_scan): Take an additional argument requesting
6152         exact matching.
6153         * src/common.h (name_scan): Change prototype.
6154         * src/delete.c, src/incremen.c, src/update.c: Update invocations
6155         of name_scan.
6156
6157 2005-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>
6158
6159         * src/common.h (struct name): New member `explicit'. Remove unused
6160         member `isdir'.
6161         * src/incremen.c (procdir): If name_scan() returns something,
6162         check if it was explicitly given in the command line
6163         * src/names.c (addname,add_hierarchy_to_namelist): Initialize
6164         explicit member appropriately.
6165
6166         * src/incremen.c (procdir): If --one-file-system is given and a
6167         directory is found to be on another device, *and* this directory
6168         is explicitly given in the command line, then do not omit it.
6169
6170 2005-12-11  Sergey Poznyakoff  <gray@gnu.org.ua>
6171
6172         * NEWS: Update
6173         * doc/tar.texi: Document --delay-directory-restore option.
6174         (Configuring Help Summary): Document usage of ARGP_HELP_FMT
6175         variable to customize help output.
6176         * src/common.h (delay_directory_restore_option): New global.
6177         * src/extract.c (directories_first): Replaced by
6178         delay_directory_restore_option. All uses changed.
6179         * src/tar.c (options,parse_opt): New options
6180         --delay-directory-restore and --no-delay-directory-restore
6181
6182 2005-12-09  Sergey Poznyakoff  <gray@gnu.org.ua>
6183
6184         * src/buffer.c (open_archive): Add default case to shut up gcc.
6185         * src/common.h (set_file_atime): Add prototype.
6186         * src/create.c (to_chars_subst): Remove unused variable
6187         Make sure useful result code is returned.
6188         * src/incremen.c (read_directory_file): Fix format string
6189         Thanks Eric Blake for reporting.
6190
6191 2005-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>
6192
6193         * doc/tar.texi (Current status): Renamed to 'Changes' and moved to
6194         appendices.
6195         (Large or Negative Values): Rewritten
6196         * src/common.h (gid_to_chars, major_to_chars, minor_to_chars)
6197         (mode_to_chars, off_to_chars, size_to_chars, time_to_chars)
6198         (uid_to_chars, uintmax_to_chars): Return bool
6199         * src/create.c (gid_to_chars, major_to_chars, minor_to_chars)
6200         (mode_to_chars, off_to_chars, size_to_chars, time_to_chars)
6201         (uid_to_chars, uintmax_to_chars): Return bool
6202         (to_chars): Return bool
6203         (start_header): Check return values of conversion routines. Fail
6204         if unable to store data in the header.
6205
6206 2005-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>
6207
6208         * doc/tar.texi: Following the discussion with Karl Berry,
6209         discontinue using @value{} substitutions for Texinfo commands.
6210         Properly index all long options. Print a
6211         separate long option index.
6212         * doc/value.texi: Remove @set's
6213
6214         * doc/tar.texi: Update --info-script documentation
6215         Resolve some more FIXMEs.
6216         * scripts/dump-remind.in: Use TAR_VOLUME instead of reading volno
6217         file.
6218         * src/buffer.c (new_volume): Update invocation
6219         (change_tape_menu): New function. Disable '!' command if given
6220         --restrict option.
6221         * src/common.h (sys_exec_info_script): Update declaration
6222         (restrict_option): New global
6223         * src/system.c (sys_exec_info_script): The script can supply new
6224         archive name to use by writing it to file descriptor 3.
6225         * src/tar.c (options): Add --restrict option. Use macros for
6226         option grouping.
6227         (license): Print full list of copyright years
6228         * NEWS: Update
6229
6230 2005-12-06  Eric Blake  <ebb9@byu.net> (trivial changes)
6231
6232         * configure.ac (DENSITY_LETTER): Fix m4 overquoting.
6233         * .cvsignore: Ignore .bootstrap.
6234
6235 2005-12-06  Sergey Poznyakoff  <gray@gnu.org.ua>
6236
6237         * doc/tar.texi: Document --to-command and --info-script
6238         options. Add missing xrefs.
6239         * src/buffer.c (new_volume): Use sys_exec_info_script() instead of
6240         system().
6241         * src/common.h (archive_format_string,subcommand_string)
6242         (sys_exec_info_script): New prototypes.
6243         * src/system.c (sys_exec_info_script): New function.
6244         * src/tar.c (archive_format_string): Remove static qualifier.
6245         (subcommand_string): New function.
6246
6247 2005-12-01  Sergey Poznyakoff  <gray@gnu.org.ua>
6248
6249         * src/extract.c: Fix restoring of directory timestamps from
6250         incremental archives.
6251         (directories_first): New variable.
6252         (prepare_to_extract): Set directories_first
6253         (extract_archive): Call apply_nonancestor_delayed_set_stat() only
6254         if not extracting from an incremental archive
6255         (extract_dir): Obtain root_device here, to make sure it works
6256         correctly with -C.
6257
6258         * src/incremen.c (purge_directory): Skip the member and return if
6259         the archive is not in incremental format.
6260         * tests/incr02.at: New testcase
6261         * tests/Makefile.am: Add incr02.at
6262         * tests/testsuite.at: Likewise
6263
6264         * THANKS: Add Guerkan Karaman.
6265         * NEWS: Update
6266
6267 2005-11-30  Paul Eggert  <eggert@cs.ucla.edu>
6268
6269         * doc/tar.texi (Option Summary): Rewrite the
6270         --atime-preserve=system description in response to Ian Turner's
6271         proposed patch.
6272
6273 2005-11-30  Ian Turner  <ian@zmanda.com>
6274
6275         * doc/tar.texi (Extracting Specific Files): Remove obsolescent
6276         FIXME.
6277
6278 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
6279
6280         * NEWS: New option --atime-preserve=system, which uses O_NOATIME.
6281         * THANKS: Add Ian Turner.
6282
6283         * configure.ac: Prefer AC_CHECK_HEADERS_ONCE to AC_CHECK_HEADERS.
6284         Check for stropts.h and sys/filio.h too, for _FIOSATIME.
6285         * doc/tar.texi: Change "modification time" to "data modification
6286         time", "change time" to "status change time", and "filesystem" to
6287         "file system", so that we use terminology consistent with POSIX.
6288         Use American spacing rather than French for sentence ends.
6289         "non-dependable" -> "undependable".
6290         (Option Summary, Attributes): Explain better the pitfalls of the
6291         --atime-preserve option, and suggest read-only mounts,loopback
6292         mounts, and noatime mounts for older systems.
6293         * doc/value.texi (op-atime-preserve-system): Renamed from
6294         op-atime-preserver-system to fix a misspelling.
6295         * src/common.h (enum atime_preserve): Use lower case for enum values.
6296         * src/compare.c: Don't include utimens.h; no longer needed.
6297         (diff_file): Use set_file_atime rather than utimens; avoid closing
6298         diff_handle until after this, so that we can set the file time stamp
6299         via the file descriptor rather than via its name.
6300         * src/create.c: Don't include utimens.h; no longer needed.
6301         (dump_regular_finish): Remove.  All callers now do its work inline.
6302         (dump_dir): New arg FD.  All callers changed.
6303         Use fdsavedir rather than savedir.
6304         (unknown_file_error): Arg is a const pointer now.
6305         (dump_file0): 2nd arg is a const pointer now.
6306         Treat directories more like files, with respect to --atime-preserve.
6307         For example, also warn if a directory changes while we are dumping it.
6308         Prefer file descriptors to file names when retrieving/setting file
6309         attributes; this saves path-resolution time and allows us to avoid
6310         changing mtime/ctime on Solaris when restoring atime as root.
6311         Use O_DIRECTORY when opening directories, to avoid some race conditions.
6312         Do not reset atime if mtime has changed.  Report an error if
6313         we cannot reset atime.
6314
6315         * lib/.cvsignore: Add malloc.h, regcomp.c, regex.c, regex.h,
6316         regex_internal.c, regex_internal.h, regexc.c; used by rpmatch.
6317
6318 2005-11-29  Ian Turner  <ian@zmanda.com>
6319
6320         First cut at adding support for --atime-preserve=system.
6321         * doc/tar.texi (Option Summary): First cut at documenting it.
6322         All other uses of --atime-preserve changed to --atime-preserve=replace.
6323         * doc/value.texi (op-atime-preserve-replace, op-atime-preserver-system):
6324         New.
6325         (op-atime-preserve): Mention METHOD.
6326         * src/common.h (atime_preserve): New enum.
6327         (atime_preserve_option): Now of the enum type rather than bool.
6328         All uses changed.
6329         * src/compare.c (diff_file): Read with O_NOATIME if asked for.
6330         * src/create.c (dump_file0): Read regular and CTG files with O_NOATIME
6331         if asked for.
6332         * src/tar.c (usage): Mention new usage.
6333         (parse_opt): Parse new usage.
6334
6335 2005-11-29  Paul Eggert  <eggert@cs.ucla.edu>
6336
6337         * THANKS: Convert back to UTF-8, sort (using LC_ALL=C on Debian
6338         stable), and consistently use tabs rather than spaces.
6339
6340 2005-11-27  Sergey Poznyakoff  <gray@gnu.org.ua>
6341
6342         * src/xheader.c: Remove parts of code prematurely introduced
6343         yesterday. Thanks Eric Blake.
6344
6345 2005-11-26  Sergey Poznyakoff  <gray@gnu.org.ua>
6346
6347         * src/xheader.c (xheader_format_name): Fix memory leak.
6348
6349 2005-11-11  Sergey Poznyakoff  <gray@gnu.org.ua>
6350
6351         * gnulib.modules: Add rpmatch
6352         * lib/stdopen.h, lib/stdopen.c: New file. Imported from coreutils.
6353         * lib/Makefile.tmpl: Add stdopen.h, stdopen.c
6354         * po/POTFILES.in: Add rpmatch.c
6355         * src/tar.c (confirm): Rewritten using rpmatch.
6356         (decode_options): Minor optimizations
6357         (main): Call stdopen() to ensure the first three descriptors are
6358         open.
6359
6360         * tests/multiv01.at, tests/multiv02.at, tests/multiv03.at,
6361         tests/multiv04.at, tests/sparsemv.at, tests/sparsemvp.at,
6362         tests/star/multi-fail.at: Close stdin so that if something fails
6363         causing tar to ask for the next volume, it won't hang the
6364         testsuite.
6365
6366         * src/buffer.c (flush_write,flush_read): Change data type.
6367         (flush_archive): Compute actual buffer fill level before calling
6368         low level function.
6369         (close_archive): Call flush_archive again if the first call
6370         resulted in partially filled buffer.
6371         (try_new_volume): Rewritten handling of initial headers.
6372         (add_chunk_header): New function. Write an additional header
6373         before the continuation chunk. The purpose of the header is to
6374         allow third-party tars to extract the member.
6375         (simple_flush_write): Take an argument.
6376         (_gnu_flush_write): Correctly handle partially filled buffers.
6377         * src/common.h (flush_read,flush_write): Functions, again.
6378         (write_extended): Changed declaration
6379         (xheader_format_name): New declaration
6380         * src/create.c (write_extended): Change type and meaning of
6381         the first argument. All callers updated
6382         * src/xheader.c (xheader_format_name): Remove static
6383         qualifier. Change last argument.
6384         Correct buffer size calculation (allocated too much space).
6385         (xheader_write): Increase global_header_count here ...
6386         (xheader_write_global): ... instead of here
6387
6388         * tests/testsuite.at (AT_TAR_CHECK): Define TEST_TAR_FORMAT
6389         * tests/multiv01.at: Update
6390         * tests/multiv02.at: Update
6391         * tests/multiv03.at: Update
6392         * tests/sparsemvp.at: Update
6393         * tests/star/multi-fail.at: Update
6394
6395         * scripts/tarcat: Handle archives in pax format. Improve handling
6396         of traditional archives.
6397         * doc/tar.texi (Tarcat): New node
6398
6399 2005-11-10  Sergey Poznyakoff  <gray@gnu.org.ua>
6400
6401         Fix splitting of sparse files between the volumes.
6402
6403         * src/buffer.c (try_new_volume): Bugfix. Always check
6404         continued_file_name. If it is absent, the volume is out
6405         of sync.
6406         (add_multi_volume_header): Create GNU.volume.filename keyword in
6407         the extended header.
6408         * src/sparse.c (sparse_dump_region): Call mv_size_left.
6409         (sparse_dump_file): Enclose the loop in mv_begin/mv_end.
6410         * src/system.c: Do not pad compressed output if it goes to
6411         stdout.
6412         * src/xheader.c (xhdr_tab): New keyword GNU.volume.filename.
6413
6414         * tests/sparsemv.at: New testcase
6415         * tests/sparsemvp.at: New testcase
6416         * tests/Makefile.am: Add sparsemv.at and sparsemvp.at.
6417         * tests/testsuite.at: Likewise.
6418
6419 2005-11-09  Sergey Poznyakoff  <gray@gnu.org.ua>
6420
6421         * src/buffer.c: Rewritten in a more modular fashion to provide
6422         GNU extensions (multi-volume archives and archive labels) in
6423         pax format.
6424         NOTICE, that some of the aspects (e.g. splitting the archive
6425         on the extended header boundary) are still not solved, others
6426         (splitting a sparse file between the volume) require additional
6427         testing. Wait for the next commit.
6428
6429         (volume_label,continued_file_name,continued_file_size)
6430         (continued_file_offset): New globals.
6431         (save_name,save_totsize,save_sizeleft): Make static
6432         (mv_begin,mv_end,mv_total_size,mv_size_left): New functions
6433         (open_archive,flush_write,flush_read): Rewritten
6434
6435         * src/common.h (save_name,save_sizeleft,save_totsize): Remove
6436         globals.
6437         (volume_label,continued_file_name,continued_file_size): New
6438         variables.
6439         (flush_read,flush_write): Pointers to functions
6440         (mv_begin,mv_end,mv_total_size,mv_size_left): New functions
6441         (write_extended): New function.
6442
6443         * src/compare.c, src/create.c, src/extract.c, src/incremen.c,
6444         src/list.c: Use mv_.* functions uniformly instead of fiddling
6445         with the global variables.
6446         * src/sparse.c: Use mv_.* functions where necessary.
6447         * src/tar.c (decode_options): Allow to use --multi-volume and
6448         --label with pax archives.
6449         * src/xheader.c (xhdr_tab): Support for new GNU keywords.
6450
6451         * tests/delete01.at, tests/delete02.at, tests/delete03.at,
6452         tests/delete04.at, tests/delete05.at, tests/extrac01.at,
6453         tests/extrac02.at, tests/extrac03.at, tests/extrac04.at,
6454         tests/extrac05.at, tests/incr01.at, tests/incremental.at,
6455         tests/listed01.at, tests/listed02.at, tests/long01.at,
6456         tests/longv7.at, tests/multiv01.at, tests/multiv02.at,
6457         tests/multiv03.at, tests/multiv04.at, tests/options.at,
6458         tests/options02.at, tests/same-order01.at, tests/same-order02.at,
6459         tests/sparse01.at, tests/sparse02.at, tests/sparse03.at,
6460         tests/star/multi-fail.at (AT_KEYWORDS): Improve to allow execution
6461         of related tests in groups.
6462
6463         * doc/tar.texi: Update
6464
6465 2005-11-07  Paul Eggert  <eggert@cs.ucla.edu>
6466
6467         * src/xheader.c (struct xhdr_tab.coder): Last arg is void const *,
6468         not void *, to avoid create.c warning from GCC "passing argument 3
6469         of 'xheader_store' discards qualifiers from pointer target type".
6470         (dummy_coder, atime_coder, gid_coder, gname_coder, linkpath_coder):
6471         (ctime_coder, mtime_coder, path_coder, size_coder, uid_coder):
6472         (uname_coder, sparse_size_coder, sparse_numblocks_coder):
6473         (sparse_offset_coder, sparse_numbytes_coder, dumpdir_coder):
6474         (xheader_store): Likewise.
6475         * src/common.h (xheader_store): Likewise.
6476
6477 2005-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
6478        and  Paul Eggert  <eggert@cs.ucla.edu>
6479
6480         * src/tar.c (NS_PRECISION_FORMAT_MASK): New macro.
6481         (tar_timespec_cmp): New function. Wrapper over
6482         timespec_cmp using the timespec precision provided by the
6483         current archive format.
6484         * src/common.h (tar_timespec_cmp): New declaration.
6485         * src/compare.c (diff_file): Use tar_timespec_cmp.
6486         * src/extract.c (file_newer_p): Likewise.
6487         * src/update.c (update_archive): Likewise.
6488         * tests/truncate.at: Reverted changes
6489         * tests/update.at: Reverted changes
6490
6491 2005-11-07  Sergey Poznyakoff  <gray@gnu.org.ua>
6492
6493         Support for incremental formats in pax archives.
6494         Fixed POSIX compatibility of `sparse' extended header keywords.
6495
6496         * src/common.h (dumpdir_size,get_gnu_dumpdir)
6497         (xheader_string_begin,xheader_string_add)
6498         (xheader_string_end): New functions.
6499         * src/create.c (dump_dir0): Handle incremental backups in pax
6500         archives.
6501         * src/incremen.c (dumpdir_size, get_gnu_dumpdir): New functions.
6502         (purge_directory): Use stat_info.dumpdir instead of getting its
6503         value explicitly.
6504         * src/list.c (list_archive): Handle incremental backups in pax
6505         format.
6506         (decode_header): Initialize stat_info.dumpdir
6507         * src/sparse.c (sparse_diff_file): Bugfix: set seekable.
6508         (pax_dump_header): Store sparse map in GNU.sparse.map. If this
6509         variable has been explicitly deleted, use GNU.sparse.offset/
6510         GNU.sparse.numbytes variables.
6511         * src/tar.c (decode_options): Incremental options are allowed with
6512         --format=pax
6513         (tar_stat_destroy): Free dumpdir
6514         * src/tar.h (struct tar_stat_info.dumpdir): New member.
6515         * src/xheader.c (xheader_keyword_deleted_p): Remove static
6516         qualifier.
6517         (struct xhdr_tab.decoder): Change prototype. POSIX allows string
6518         values to contain embedded nulls, so take an extra argument
6519         specifying the length of the string.
6520         (decx,decg,dummy_decoder,atime_decoder,gid_decoder)
6521         (gname_decoder,linkpath_decoder,ctime_decoder,mtime_decoder)
6522         (path_decoder,size_decoder,uid_decoder,uname_decoder)
6523         (sparse_size_decoder,sparse_numblocks_decoder)
6524         (sparse_offset_decoder,sparse_numbytes_decoder): Likewise.
6525         (decode_record): Pass value length to the handler
6526         (run_override_list): Pass value length to the decoder
6527         (xheader_print_n): New function
6528         (xheader_print): Rewritten using xheader_print_n
6529         (xheader_finish): Do not rely om strlen to compute the length of
6530         the collected string: it can contain embedded nulls
6531         (xheader_string_begin,xheader_string_add,xheader_string_end): New
6532         functions.
6533         (sparse_map_decoder,dumpdir_coder,dumpdir_decoder): New
6534         functions. Handle GNU.sparse.map and GNU.dumpdir variables.
6535         (xhdr_tab): Add new variables.
6536
6537         * tests/incr01.at: Test gnu, oldgnu, and posix formats
6538         * tests/incremental.at: Likewise
6539
6540 2005-11-06  Paul Eggert  <eggert@cs.ucla.edu>
6541
6542         * NEWS: Minor language and white space fixes.
6543
6544         * tests/truncate.at: Create files whose time stamps must fall on
6545         1-second boundaries.  This prevents tests from failing on hosts
6546         like Solaris 8 that have nanosecond-resolution file time stamps.
6547         * tests/update.at: Likewise.
6548
6549         * src/xheader.c (strtoimax, strtoumax): Remove decls; now done
6550         in system.h.
6551
6552 2005-11-06  Sergey Poznyakoff  <gray@gnu.org.ua>
6553
6554         * doc/tar.texi: Properly document incremental dumps
6555         * doc/value.texi: Likewise.
6556         * doc/snapshot.texi: Likewise.
6557
6558 2005-11-05  Sergey Poznyakoff  <gray@gnu.org.ua>
6559
6560         Improve listed incremental format:
6561
6562         * src/common.h (update_parent_directory): New prototype.
6563         * src/create.c (dump_file): Call update_parent_directory.
6564         * src/incremen.c (struct directory.mtime): New member.
6565         (note_directory): Take additional arguments. All callers updated.
6566         (scan_directory): Updated to use more metadata. In particular,
6567         this allows to correctly detect renamed files.
6568         (read_directory_file,write_directory_file)
6569         (write_directory_file_entry): Support new directory file format.
6570         * tests/listed01.at: Sleep 1 sec before creating second file.
6571         * tests/listed02.at: Never skip the test. It should work on any
6572         filesystem.
6573
6574         * doc/snapshot.texi: New file
6575         * doc/tar.texi: Update.
6576         * doc/Makefile.am: Update.
6577
6578 2005-11-04  Paul Eggert  <eggert@cs.ucla.edu>
6579
6580         * src/extract.c (set_stat): Rewrite to avoid bug in Forte
6581         Developer 7 C 5.4 Patch 111708-09 (2004-02-19).
6582
6583 2005-11-04  Sergey Poznyakoff  <gray@gnu.org.ua>
6584
6585         * bootstrap: Fix quoting in help output.
6586         (update_po): Use backward-compatible wget option --cache instead
6587         of deprecated -C to accommodate for wget 1.10.
6588         Changes proposed by Eric Blake
6589         * THANKS: Add Eric Blake
6590
6591 2005-11-02  Paul Eggert  <eggert@cs.ucla.edu>
6592
6593         * doc/tar.texi: Consistently put two spaces after sentences,
6594         and put commas after "i.e." and "e.g.".  This is the usual GNU
6595         style in manuals.
6596
6597         * lib/.cvsignore: Add creat-safer.c, fcntl--.h, fcntl-safer.h,
6598         open-safer.c, openat-die.c, verify.h, to accommodate recent gnulib
6599         changes.
6600
6601 2005-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>
6602
6603         * src/compare.c (diff_dumpdir): Pass a valid device number to
6604         get_directory_contents.
6605
6606         * THANKS: Add John Thomas McDole
6607
6608         * bootstrap: If file `.bootstrap' exists in the cwd and is
6609         readable, prepend its contents to the command line
6610
6611 2005-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>
6612
6613         * tests/link01.at: Skip test if ln fails (suppose the OS does
6614         not support hard links).
6615
6616 2005-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>
6617
6618         * src/tar.c (decode_options): Report error if -A or -r is used
6619         together with compression option.
6620
6621 2005-09-29  Sergey Poznyakoff  <gray@gnu.org.ua>
6622
6623         * doc/tar.texi: Use @option and @kbd consistently.
6624         Document new options.
6625
6626 2005-09-28  Sergey Poznyakoff  <gray@gnu.org.ua>
6627
6628         * NEWS: Updated
6629         * src/common.h (show_stored_names_option): New variable
6630         * src/list.c (print_header): If show_stored_names_option is given,
6631         list member names as stored in the archive. Patch proposed by Erik
6632         Cumps <erik.cumps@icos.be>
6633         * src/tar.c: Implement --show-stored-names option
6634
6635         * src/common.h (test_label_option): New variable;
6636         * src/list.c (print_header): Special handling if test_label_option
6637         is set.
6638         * src/names.c (all_names_found): If test_label_option is set
6639         return true.
6640         * src/tar.c: New option --test-label tests the archive volume
6641         label. The option proposed by Wouter Verhelst <wouter@nixsys.be>
6642
6643 2005-09-21  Paul Eggert  <eggert@cs.ucla.edu>
6644
6645         * tests/Makefile.am (clean-local): Don't attempt to run
6646         $(TESTSUITE) if it doesn't exist.  Problem reported by
6647         Eric Blake.
6648
6649 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
6650
6651         Don't filter time stamps through the resolution supported
6652         by struct stat; keep them to full nanosecond resolution.
6653         This affects behavior only on older hosts or file systems
6654         that have lower-resolution time stamps.
6655         * src/common.h (OLDER_STAT_TIME): Parenthesize arg.
6656         (OLDER_TAR_STAT_TIME): New macro.
6657         (code_timespec): New function.
6658         (BILLION, LOG10_BILLION, TIMESPEC_STRSIZE_BOUND): New constants.
6659         * src/compare.c (diff_file): Use full time stamp resolution.
6660         * src/create.c (start_header, dump_file0): Likewise.
6661         (start_header, dump_file0): Adjust to new structure layout.
6662         (dump_regular_finish): Simplify by using timespec_cmp.
6663         * src/extract.c (struct delayed_set_stat): Don't store stat info
6664         that we don't need, to save space.  All uses changed.
6665         (struct delayed_set_stat, struct delayed_link, file_newer_p):
6666         (create_placeholder_file, extract_link, apply_delayed_links):
6667         Use full time stamp resolution.
6668         (check_time): Use code_timespec rather than rolling our own code.
6669         (set_stat, delay_set_stat): Arg now points to tar_stat_info to
6670         avoid losing time information.  All callers changed.
6671         * src/list.c (read_and, decode_header, print_heaeder):
6672         Use full time stamp resolution.
6673         * src/misc.c (code_timespec): New function.
6674         * src/tar.h (struct tar_stat_info): Record atime, mtime, ctime
6675         separately, for benefit of hosts with lower resolution.
6676         * src/update.c (update_archive): Use full time stamp resolution.
6677         * src/xheader.c (code_time): Use new code_timespec function
6678         to simplify code.
6679         (atime_coder, atime_decoder, ctime_coder, ctime_decoder):
6680         (mtime_coder, mtime_decoder): Use full time stamp resolution.
6681
6682         Report time stamps to full resolution in environment.
6683         Report memory allocation failures rather than ignoring them.
6684         * src/system.c (time_to_env): New function.
6685         (oct_to_env, str_to_env, chr_to_env): Report memory allocation failures.
6686         (stat_to_env): Report full resolution in time stamps.
6687
6688 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
6689
6690         Merge changes from gnulib for file system sub-second time stamps.
6691         * configure.ac: Remove checks for struct stat.st_spare1, struct
6692         stat.st_atim.tv_nsec, struct stat.st_atimespec.tv_nsec, struct
6693         stat.st_atimensec, as gnulib now does this for us.
6694         Similarly for LIB_CLOCK_GETTIME.
6695         * gnulib.modules: Add stat-time.
6696         * lib/.cvsignore: Add stat-time.h.
6697         * src/common.h: Include stat-time.h.
6698         (timespec_lt): Remove.  All callers changed to use timespec_cmp.
6699         (get_stat_atime, get_stat_ctime, get_stat_mtime):
6700         (set_stat_atime, set_stat_ctime, set_stat_mtime):
6701         Remove; now defined by stat-time.h.
6702
6703 2005-09-14  Sergey Poznyakoff  <gray@gnu.org.ua>
6704
6705         * src/incremen.c (list_dumpdir): New function. Used to dump
6706         contents of GNUTYPE_DUMPDIR blocks.
6707         * src/common.h (list_dumpdir): Likewise.
6708         * src/list.c (list_archive): Use list_dumpdir() to display
6709         GNUTYPE_DUMPDIR blocks. Do that only if two or more -v options are
6710         given.
6711
6712 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
6713
6714         * lib/.cvsignore: Adjust to current gnulib and modules used.
6715         Add getdelim.c, getdelim.h, mbchar.c, mbchar.h, mbuiter.h, memchr.c,
6716         pipe-safer.c, size_max.h, strdup.c, strdup.h, strnlen.h, strnlen1.c,
6717         strnlen1.h, unistd--.h.
6718         Remove getndelim2.c, getndelim2.h, pathmax.h, sysexits.h, xstrdup.c.
6719
6720         Treat fishy-looking hard links like fishy-looking symlinks.
6721         * src/extract.c (struct delayed_set_stat): Rename after_symlinks
6722         member to after_links.  All uses changed.
6723         (struct delayed_link): Renamed from struct delayed_symlink.
6724         All uses changed.  New member is_symlink.
6725         (delayed_link_head): Renamed from delayed_symlink_head.  All uses
6726         changed.
6727         (create_placeholder_file): New function, taken from extract_symlink.
6728         (extract_link): Create placeholders for fishy-looking hard links.
6729         (extract_symlink): Move code into create_placeholder_file.
6730         (apply_delayed_links): Renamed from apply_delayed_symlinks.
6731         All uses changed.  Create both hard links and symlinks.
6732
6733 2005-09-03  Paul Eggert  <eggert@cs.ucla.edu>
6734
6735         * README-alpha: Modernize description of software required for
6736         developers.
6737
6738 2005-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>
6739
6740         * gnulib.modules: Add strdup
6741         * src/incremen.c (purge_directory): Do not dereference symbolic
6742         links. Bug reported by Ralph Corderoy <ralph@inputplus.co.uk> and
6743         David Brown <davidb@davidb.org>
6744         * tests/incr01.at: New test.
6745         * tests/Makefile.am: Add incr01.at
6746         * tests/testsuite.at: Likewise
6747         * THANKS: Updated
6748
6749 2005-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>
6750
6751         * src/incremen.c (read_directory_file): Use strtoumax to read
6752         snapshot file contents.
6753         (write_directory_file_entry): Use umaxtostr().
6754
6755 2005-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>
6756
6757         * src/create.c (file_dumpable_p,dump_file0): Fix handling of
6758         sparse files to /dev/null with --totals option.
6759         * tests/update.at: Remove dependency on file order.
6760
6761 2005-07-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6762
6763         * doc/tar.texi: Fix typo.
6764
6765 2005-07-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6766
6767         * tests/pipe.at: Pipe the output from `tar xfv' through sort.
6768
6769 2005-06-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6770
6771         * src/sparse.c (tar_sparse_init): Fill structure with zeros. Call
6772         sparse_select_optab(). All callers updated.
6773         (sparse_member_p, sparse_fixup_header): Use tar_sparse_init().
6774
6775 2005-06-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6776
6777         * src/sparse.c (pax_sparse_member_p): Checking member size
6778         vs. file size is not reliable enough. Use sparse_map_avail.
6779
6780         * tests/star/gtarfail.at: Adapt to the new output format
6781         * tests/star/gtarfail2.at: Likewise
6782         * tests/star/multi-fail.at: Likewise
6783         * tests/star/pax-big-10g.at: Likewise
6784         * tests/star/ustar-big-2g.at: Likewise
6785         * tests/star/ustar-big-8g.at: Likewise
6786
6787         * tests/sparse03.at: New test.
6788         * tests/Makefile.am: Add sparse03.at
6789         * tests/testsuite.at: Likewise
6790
6791         * src/xheader.c (size_decoder): Do not set archive_file_size.
6792
6793         Fix bugs introduced yesterday:
6794
6795         * src/sparse.c (tar_sparse_init):  Initialize
6796         dimped_size to 0.
6797         (sparse_scan_file): Initialize archive_file_size to 0. The
6798         variable keeps size of the file *as stored in the archive*, not
6799         the size reported by stat.
6800
6801 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
6802
6803         A sweep of the sparse code prompted by a bug report by Jim Meyering.
6804         * src/sparse.c: Include <inttostr.h>.
6805         (struct tar_sparse_file): offset and dumped_size are off_t, not
6806         size_t.  optab is now const *.
6807         (dump_zeros): Return bool success flag, not off_t.
6808         All callers changed.
6809         Use a constant-zero buffer rather than clearing a buffer each time.
6810         Don't mess up if write fails.
6811         (dump_zeros, check_sparse_region):
6812         Don't assume off_t is no wider than size_t.
6813         (tar_sparse_init): Don't bother clearing a field that is already clear.
6814         (zero_block_p): First arg is const *, not *.
6815         (clear_block, SPARSES_INIT_COUNT): Remove.
6816         (sparse_add_map): First arg is now struct start_stat_info *, not
6817         struct tar_sparse_file *.  All callers changed.
6818         Use x2nrealloc to check for size_t overflow.
6819         (parse_scan_file): Cache commonly-used parts of file.
6820         Use an auto buffer, not a static one.
6821         Don't bother clearing the buffer; not needed.
6822         Don't bother clearing items that are already clear.
6823         (oldgnu_optab, star_optab, pax_optab): Now const.
6824         (sparse_dump_region): Don't bother clearing the buffer before
6825         reading into it; just clear the parts that aren't read into.
6826         (sparse_dump_file): Clear the whole local variable 'file'.
6827         (diff_buffer): Remove; now a local var.
6828         (check_sparse_region): Don't bother clearing buffer before
6829         reading into it.  Don't assume off_t is promoted to long.
6830         (oldgnu_get_sparse_info, star_get_sparse_info):
6831         Use an auto status, not static.
6832         * src/tar.h (struct tar_stat_info): had_trailing_slash is
6833         now bool, not int.
6834         * src/xheader.c (sparse_offset_coder, sparse_numbytes_coder):
6835         Rewrite to avoid cast.
6836         (sparse_offset_decoder, sparse_numbytes_decoder):
6837         Diagnose excess entries rather than crashing.
6838
6839 2005-06-22  Jim Meyering  <jim@meyering.net>
6840
6841         * src/common.h (timespec_lt): Add a return type: bool.
6842
6843 2005-06-21  Paul Eggert  <eggert@cs.ucla.edu>
6844
6845         Further improvements inspired by Jim Meyering's fixes.
6846
6847         * NEWS: Better support for full-resolution time stamps.
6848         The -v option now prints time stamps only to 1-minute resolution.
6849         * gnulib.modules: Add utimens.
6850         * lib/.cvsignore: Add imaxtostr.c, inttostr.c, inttostr.h,
6851         offtostr.c, umaxtostr.c, utimens.c, utimens.h.  Remove paxconvert.c.
6852         * lib/Makefile.tmpl (libtar_a_SOURCES): Remove paxconvert.c.
6853         * lib/paxconvert.c: Remove; superseded by umaxtostr.c.
6854         * po/POTFILES.in: Remove lib/paxconvert.c.  Add lib/xalloc-die.c,
6855         lib/obstack.c.
6856         * src/buffer.c (set_start_time, compute_duration, start_time):
6857         Use gettime rather than rolling our own code.
6858         * src/common.h (OLDGNU_NAME_FIELD_SIZE, MAXOCTAL11, MAXOCTAL7): Remove.
6859         (newer_ctime_option): Remove.
6860         (timespec_lt): New function.
6861         (OLDER_STAT_TIME): Use it.
6862         (string_to_chars): First arg is char const *, not char *.
6863         (tartime): Time arg is now struct timespec.  New bool arg.
6864         All callers changed.
6865         (code_ns_fraction): New decl.
6866         (sys_stat_nanoseconds): Remove decl.
6867         (get_stat_atime, get_stat_ctime, get_stat_mtime): New functions.
6868         (set_stat_atime, set_stat_ctime, set_stat_mtime): New functions.
6869         * src/compare.c: Include utimens.h rather than rolling our own.
6870         (diff_dir, diff_file, diff_link, diff_symlink, diff_special):
6871         Prototype.
6872         (diff_dumpdir, diff_multivol): Prototype.
6873         (diff_file): Support higher-resolution time stamps.
6874         * src/create.c: Include utimens.h rather than rolling our own.
6875         (MAX_OCTAL_VAL): New macro.
6876         (tar_copy_str, string_to_chars): Don't bother to zero-fill;
6877         the destination is already zeroed.
6878         (string_to_chars): First arg is char const *.
6879         (start_private_header): Use MINOR_TO_CHARS, not MAJOR_TO_CHARS,
6880         for minor device number.
6881         (write_header_name, dump_hard_link, dump_file0):
6882         Simplify test for old GNU format.
6883         (start_header): Put in placeholders for uid, etc., even when
6884         using extended headers, for benefit of older "tar" implementations.
6885         Don't assume uintmax_t is wider than 32 bits.
6886         Output extended header for mtime if needed.
6887         (dump_regular_finish, dump_file0):
6888         Support extended time stamp resolution.
6889         * src/extract.c: Include utimens.h rather than rolling our own.
6890         (check_time): Support extended time stamp resolution.
6891         * src/list.c: Include <inttostr.h>.
6892         (tartime): Use umaxtostr rather than stringify_uintmax_t_backwards.
6893         * src/xheader.c: Include <inttostr.h>.
6894         Do not include <xstrtol.h>.
6895         (strtoimax) [!HAVE_DECL_STRTOIMAX && !defined strtoimax]: New decl.
6896         (strtoumax) [!HAVE_DECL_STRTOUMAX && !defined strtoumax]: New decl.
6897         (BILLION, LOG10_BILLION): New constants.
6898         (to_decimal): Remove; superseded by inttostr.  All callers changed
6899         to use umaxtostr.
6900         (xheader_format_name): Don't assume pids and uintmax_t values
6901         fit in 63 bytes (!) when printed.
6902         (decode_record): Don't bother to check for ERANGE; an out of range
6903         value must be treater than len_max anyway.
6904         If the length is out of range, output it in the diagnostic.
6905         (format_uintmax): Remove; all callers changed to use umaxtostr.
6906         (xheader_print): Don't assume sizes can be printed in 99 bytes (!).
6907         (out_of_range_header): New function.
6908         (decode_time): Use it.
6909         (code_time): Accept struct timespec, not time_t and unsigned long.
6910         All callers changed.  Size sbuf properly, and remove unnecessary check.
6911         Don't assume time stamps can fit in 199 bytes.
6912         Handle negative time stamps.  Handle fractional time stamps
6913         more consistently.  Don't output unnecessary trailing zeros.
6914         (decode_time): Yield struct timespec, not time_t and unsigned long.
6915         All callers changed.
6916         Handle negative time stamps.  Truncate towards minus infinity
6917         consistently.  Improve overflow checks, and output a better
6918         diagnostic on overflow.
6919         (code_num): Don't assume uintmax_t can be printed in 99 bytes (!).
6920         (decode_num): New function, for better diagnostics.
6921         (atime_coder, atime_decoder, gid_decoder, ctime_coder):
6922         (ctime_decoder, mtime_coder, mtime_decoder, size_decoder):
6923         (uid_decoder, sparse_size_decoder, sparse_numblocks_decoder):
6924         (sparse_offset_decoder, sparse_numbytes_decoder):
6925         Use decode_num, etc., instead of xstrtoumax, etc.
6926
6927 2005-06-21  Jim Meyering  <jim@meyering.net>
6928
6929         Carefully crafted invalid headers can cause buffer overrun.
6930         Invalid header fields go undiagnosed.
6931         Some valid time strings are ignored.
6932
6933         * src/xheader.c (sparse_numblocks_decoder): Remove unchecked use
6934         of `calloc'.  Use xcalloc instead.
6935         (decode_time, gid_decoder, size_decoder, uid_decoder):
6936         (sparse_size_decoder, sparse_offset_decoder, sparse_numblocks_decoder):
6937         Ensure that the result of calling xstrtoumax is no larger than
6938         the maximum value for the target type.  Upon any failure, exit with
6939         a diagnostic.
6940         (sparse_numblocks_decoder): Avoid buffer overrun/heap corruption:
6941         use x2nrealloc, rather than `n *= 2' and xrealloc(p, n,....
6942         (decode_time): Rewrite to accept time strings like
6943         1119018481.000000000.  Before, such strings were always ignored.
6944
6945 2005-06-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6946
6947         * src/create.c (dump_file0): Check for is_avoided_name()
6948         first. Fixes bug reported by Martin Lohmeier
6949         <martin@mein-horde.de>
6950         * tests/update.at: New file
6951         * tests/Makefile.am (TESTSUITE_AT): Add update.at
6952         * tests/testsuite.at: Likewise
6953
6954 2005-06-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6955
6956         * configure.ac (AC_STRUCT_ST_BLKSIZE)
6957         (AC_STRUCT_ST_BLOCKS): Removed. Handled by system.m4.
6958
6959 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
6960
6961         * src/names.c (excluded_name): excluded_filename ->
6962         excluded_file_name, because the name was changed in gnulib.
6963
6964 2005-05-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6965
6966         * src/tar.c (read_name_from_file,update_argv): Automatically
6967         detect nul-terminated list files.
6968         * NEWS: Updated
6969
6970 2005-05-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6971
6972         * scripts/backup.sh.in: Bugfixes.
6973
6974 2005-05-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6975
6976         * scripts/backup.in: Minor fixes
6977         * scripts/backup.sh.in (mt_begin,mt_rewind)
6978         (mt_offline,mt_status): Use $MT to invoke mt
6979         (init_common): Set --rsh-command option for mt if TAPE_FILE is a
6980         remote archive.
6981         * doc/tar.texi: Document new backup scripts behavior
6982
6983 2005-05-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
6984
6985         * lib/.cvsignore: Updated
6986         * lib/Makefile.tmpl: Add new paxutils files
6987         * po/POTFILES.in: Likewise
6988         * src/buffer.c: Update invocations of safer_name_suffix()
6989         * src/create.c: Likewise
6990         * src/extract.c: Likewise
6991         * src/xheader.c: Likewise
6992         * src/common.h: Include paxlib.h instead of paxerror.h
6993         (safer_name_suffix,removed_prefixes_p): Removed. The functions are
6994         imported from paxutils
6995         * src/names.c (hash_string_hasher,hash_string_compare)
6996         (hash_string_insert,hash_string_lookup,removed_prefixes_p)
6997         (safer_name_suffix): Moved to paxutils
6998
6999 2005-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7000
7001         * bootstrap (copy_files): Accept optional third argument: a prefix
7002         to be appended to destination file names.
7003         Import paxutils/paxlib files.
7004         * configure.ac: Remove checking for LIB_SETSOCKOPT, it is handled
7005         by paxutils.
7006         * lib/Makefile.tmpl (libtar_a_SOURCES): Add paxerror.c paxexit.c
7007         paxconvert.c
7008         * po/POTFILES.in: Likewise.
7009         * src/common.h: Remove defines and declarations imported from
7010         paxutils
7011         * src/misc.c: Likewise
7012         * src/list.c (stringify_uintmax_t_backwards): Moved to paxutils
7013
7014 2005-05-17  Paul Eggert  <eggert@cs.ucla.edu>
7015
7016         * src/misc.c (remove_any_file): Fix typo in previous change.
7017
7018 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
7019
7020         Port to Solaris 10's treatment of unlinking directories.
7021         * gnulib-modules: Add unlinkdir.
7022         * lib/.cvsignore: Add unlinkdir.h, unlinkdir.c.
7023         * src/common.h (we_are_root): Remove extern decl; it's now static.
7024         * src/extract.c (we_are_root): Now static.
7025         * src/misc.c: Include <unlinkdir.h>.
7026         (remove_any_file): Use cannot_unlink_dir () rather than we_are_root.
7027
7028         * ChangeLog, ChangeLog.1, Makefile.am, NEWS, PORTS, README,
7029         README-alpha, TODO, bootstrap, configure.ac, doc/Makefile.am,
7030         doc/convtexi.pl, doc/fdl.texi, doc/gendocs_template,
7031         lib/Makefile.tmpl, lib/prepargs.c, lib/waitpid.c, po/POTFILES.in,
7032         scripts/Makefile.am, scripts/backup-specs, scripts/backup.in,
7033         scripts/backup.sh.in, scripts/restore.in, src/Makefile.am,
7034         src/arith.h, src/buffer.c, src/common.h, src/compare.c,
7035         src/create.c, src/delete.c, src/extract.c, src/incremen.c,
7036         src/list.c, src/mangle.c, src/misc.c, src/names.c, src/sparse.c,
7037         src/system.c, src/tar.c, src/tar.h, src/update.c, src/utf8.c,
7038         src/xheader.c, tests/Makefile.am, tests/append.at,
7039         tests/append01.at, tests/comprec.at, tests/delete01.at,
7040         tests/delete02.at, tests/delete03.at, tests/delete04.at,
7041         tests/delete05.at, tests/extrac01.at, tests/extrac02.at,
7042         tests/extrac03.at, tests/extrac04.at, tests/extrac05.at,
7043         tests/gzip.at, tests/ignfail.at, tests/incremental.at,
7044         tests/link01.at, tests/listed01.at, tests/listed02.at,
7045         tests/long01.at, tests/longv7.at, tests/multiv01.at,
7046         tests/multiv02.at, tests/multiv03.at, tests/multiv04.at,
7047         tests/old.at, tests/options.at, tests/options02.at, tests/pipe.at,
7048         tests/recurse.at, tests/same-order01.at, tests/same-order02.at,
7049         tests/shortrec.at, tests/sparse01.at, tests/sparse02.at,
7050         tests/testsuite.at, tests/truncate.at, tests/version.at,
7051         tests/volume.at, tests/star/gtarfail.at, tests/star/gtarfail2.at,
7052         tests/star/multi-fail.at, tests/star/pax-big-10g.at,
7053         tests/star/quicktest.sh, tests/star/ustar-big-2g.at,
7054         tests/star/ustar-big-8g.at:
7055         Update FSF postal mail address.
7056
7057 2005-05-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7058
7059         * NEWS: Updated
7060         * THANKS: Updated
7061         * bootstrap: Install files from paxutils/doc
7062         * doc/Makefile.am (tar_TEXINFOS): Add genfile.texi
7063         * doc/tar.texi (Genfile): New appendix
7064         * src/compare.c (diff_file): diff_handle was not initialized
7065         * src/create.c (dump_regular_file): Correctly pad archive members
7066         that shrunk during archiving. Repored by Frank Heckenbach.
7067         * src/extract.c (file_newer_p): Return false if file does not
7068         exist
7069         (prepare_to_extract): Correct warning wording.
7070         * tests/truncate.at: New test case
7071         * tests/Makefile.am: Add truncate.at
7072         * tests/testsuite.at: Likewise.
7073
7074         * doc/.cvsignore: Updated
7075         * lib/.cvsignore: Updated
7076         * tests/.cvsignore: Updated
7077
7078 2005-05-02  Paul Eggert  <eggert@cs.ucla.edu>
7079
7080         * tests/multivol04.at: Tell awk to read from /dev/null.
7081
7082         Adjust to recent gnulib changes.
7083         * lib/.cvsignore: Add dup-safer.c, fd-safer.c, unistd-safer.h.
7084         * src/common.h (initial_umask): New var.
7085         * src/create.c (start_ueader): Use it, and adjust to new modechange
7086         API.
7087         (hash_link): unsigned -> size_t parameters and result.
7088         * src/incremen.c (hash_directory): Likewise.
7089         * src/names.c (hash_string_hasher): Likewise.
7090         * src/tar.c (parse_opt): Set it, and adjust to new modechange API.
7091
7092 2005-04-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7093
7094         * tests/Makefile.am: Add shortrec.at.
7095
7096 2005-04-18  Paul Eggert  <eggert@cs.ucla.edu>
7097
7098         * src/buffer.c (reading_from_pipe): Remove.  All uses removed.
7099         (short_read): Don't warn about short reads; they're normal.
7100         * tests/shortrec.at: New file.
7101         * tests/testsuite.at: Include it.
7102
7103         * bootstrap (gnulib_modules): Don't create a file modlist.tmp, as
7104         it is sometimes left behind as a garbage file (maybe due to the
7105         multiple traps?).
7106
7107 2005-04-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7108
7109         * src/list.c: Handle Solaris 'X' type flag
7110         * src/tar.h (SOLARIS_XHDTYPE): New define
7111
7112 2005-04-06  Sergey Poznyakoff  <gray@mirddin.farlep.net>
7113
7114         * src/tar.c: Minor fixes to text messages. Proposed by Benno
7115         Schulenberg.
7116         * src/extract.c: Likewise
7117         (extract_file): Assign orig_file_name
7118         to save_name uniformly over the program. This fixes matching
7119         directory names at the start of an archive volume.
7120         * src/buffer.c (flush_write): Warn when the name of the archive
7121         straddling volume boundary is longer than 100 characters. Earlier
7122         behavior was to issue a fatal error.
7123         (struct zip_magic): Reverted part of changes from 2005-04-04.
7124         They make the maintenance too costly. Removing `unsigned'
7125         qualifier from `magic' member should be enough.
7126         * src/compare.c (diff_init): Read directory file if in listed
7127         incremental. This prevents spurious 'Contents differ' diagnostics.
7128         (diff_archive): Minor fixes to text messages
7129         (diff_file,diff_dumpdir,diff_multivol): Assign orig_file_name
7130         to save_name uniformly over the program. This fixes matching
7131         directory names at the start of an archive volume.
7132         * src/create.c: Assign orig_file_name
7133         to save_name uniformly over the program. This fixes matching
7134         directory names at the start of an archive volume.
7135         * src/list.c: Likewise
7136
7137         * tests/multiv03.at: Modified to match the new behavior
7138         * tests/multiv04.at: New file. Test splitting directory members between
7139         the archive volumes.
7140         * tests/Makefile.am: Add multiv04.at
7141         * tests/testsuite.at: Likewise.
7142
7143 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
7144
7145         * configure.ac (AC_CONFIG_AUX_DIR): Rename from config to build-aux,
7146         for reasons discussed in the thread beginning at
7147         <http://lists.gnu.org/archive/html/bug-gnulib/2005-03/msg00119.html>.
7148         * .cvsignore: Remove config; add build-aux.
7149
7150         * src/buffer.c (struct zip_magic): Use char arrays, not pointers.
7151         The unsigned char * pointer ran afoul of pedantic C compilers, and
7152         we didn't need pointers anyway.  Put the size field before the
7153         data to avoid unnecessary padding.  All uses changed.
7154         (magic) Make it const, since it doesn't change.  All uses changed.
7155
7156 2005-04-02  Paul Eggert  <eggert@cs.ucla.edu>
7157
7158         * src/xheader.c (decode_record): Don't dump core when given
7159         a corrupted extended header.  Problem reported by Jim Meyering.
7160         Also, check for other ways that the header might be invalid,
7161         e.g., missing newline at end.  Do not allow keys with nulls.
7162         Allow blanks before and after length, as POSIX requires.
7163         Do not allow leading "-" in length.  Check for length overflow.
7164         (xheader_decode, xheader_decode_global): Let decode_record
7165         check for exhaustion of record.
7166         (xheader_read): Null-terminate the extended record;
7167         decode_record relies on this.
7168
7169 2005-03-21  Paul Eggert  <eggert@cs.ucla.edu>
7170
7171         * bootstrap (TP_URL): Change from
7172         <http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
7173         <http://www.iro.umontreal.ca/translation/maint/tar/> to avoid
7174         some redirection glitches.
7175         Use "trap - 0" rather than "trap 0" to fix a POSIX-conformance bug.
7176         * doc/.cvsignore: Change "tar.info" to "tar.info*".  Sort.
7177         * lib/.cvsignore: Add intprops.h (new gnulib file).
7178
7179 2005-03-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7180
7181         * src/list.c (print_header): Print UID/GID in case of
7182         empty user/group name. This could occur when dumping
7183         files belonging to non-existing users and when listing
7184         broken archives.
7185         Reported by Igor Lautar.
7186
7187         * src/create.c: Correctly parse empty uname/gname
7188         * src/sparse.c (sparse_scan_file): Bugfix. offset had
7189         incorrect type.
7190
7191         * scripts/backup.in: Use `head -n 1'. Provide missing
7192         argument to ${MT_STATUS}. Proposed by Jan Merka.
7193         * scripts/backup.sh.in: Likewise. Fixed typo in
7194         MT_OFFLINE assignment.
7195         * scripts/restore.in (restore_fs): Use root_fs
7196
7197 2005-02-15  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7198
7199         * src/create.c: Replace strdup with xstrdup
7200         * src/names.c: Likewise
7201         * src/tar.c: Likewise
7202
7203         * tests/append01.at: Added reference to bug-tar archive
7204         * tests/listed02.at: Use -print with find.
7205
7206 2005-02-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7207
7208         * THANKS: Added Tim Adye. Fixed UTF.
7209         * src/list.c (read_header): Removed assignment to
7210         oldgnu_header.isextended. It was breaking append mode.
7211
7212         * tests/append01.at: New test.
7213         * tests/Makefile.am: Added append01.at
7214         * tests/testsuite.at: Likewise
7215
7216 2005-02-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7217
7218         * gnulib.modules: New file. List of required gnulib
7219         modules.
7220         * bootstrap: Merge list of required modules from
7221         paxutils with that from tar proper.
7222         * src/tar.c: Various fixes in help and diagnostic messages.
7223
7224 2005-02-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7225
7226         * src/common.h (EXTRACT_OVER_PIPE): New macro
7227         * src/compare.c: Code clean up.
7228         * src/extract.c (extract_archive): Do not check for
7229         EXTRACT_OVER_PIPE, decode_options() does this.
7230         * src/misc.c (exec_error,fork_error,dup2_error)
7231         (pipe_error): Removed unneeded functions.
7232         * src/system.c (sys_exec_command): Use xclose, xpipe,
7233         xfork, xdup2 and exec_fatal.
7234         * src/tar.c (options): Improved sorting. Document --backup=off.
7235         (decode_options): Clear backup_option if necessary.
7236
7237 2005-02-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7238
7239         Initial implementation of --to-command option proposed
7240         by Hansjoerg Lipp.
7241
7242         * bootstrap: Get setenv module from gnulib
7243         * src/buffer.c: Do not use 8-bit chars in comments
7244         * src/common.h (to_command_option)
7245         (ignore_command_error_option): New globals
7246         (sys_exec_command,sys_wait_command): New commands
7247         * src/extract.c (extract_file): Handle to_command_option
7248         Fix error recovery: decrease `size' by `written', not
7249         by `count', otherwise tar misses the next header
7250         Do not diagnose write error if to_command_option
7251         is set, since the command may have exited prematurely.
7252         It would be better to check for sigpipe, though.
7253         (prepare_to_extract): Handle to_command_option
7254         * src/misc.c (exec_error, fork_error, dup_error)
7255         (pipe_error): New functions
7256         * src/system.c (sys_exec_command)
7257         (sys_wait_command): New functions
7258         * src/tar.c: Handle new options --to-command,
7259         --ignore-command-error
7260         * THANKS: Added Hansjoerg Lipp
7261
7262 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
7263
7264         * src/list.c (from_header): New arg OCTAL_ONLY, normally false.
7265         All uses changed.  Fix typo that sometimes suppressed all "Archive
7266         contains obsolescent base-64 headers" warnings, not just the first
7267         one.
7268         (tar_checksum): Accept only octal checksums, since they aren't
7269         supposed to overflow into weird formats.
7270
7271         Adjust to gnulib changes.
7272         * lib/.cvsignore: Add chdir-long.c, chdir-long.h, memrchr.c,
7273         memrchr.h, openat.c, openat.h.  Remove pathmax.h (added by
7274         mistake, perhaps?), sysexit.h (my typo), xstrdup.c (gnulib removed
7275         this file).  Sort entries.
7276
7277 2005-02-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7278
7279         * src/extract.c: Further rewrite.
7280         * src/buffer.c: Removed unused variables.
7281         * src/list.c: Likewise
7282         * src/tar.c (update_argv): Changed type to void
7283
7284         * src/common.h (OLDGNU_NAME_FIELD_SIZE): New constant
7285         * src/create.c (start_private_header,write_header_name)
7286         (dump_hard_link): Restore compatibility with 1.13.25
7287         * src/extract.c (extract_archive): Rewritten
7288         * src/list.c: Add translators' comments
7289         * src/tar.c (options) Minor spelling fix
7290         * tests/star/quicktest.sh: Determine path to the tar executable.
7291
7292 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7293
7294         * po/POTFILES.in: Added tests/genfile.c
7295         * src/buffer.c (short_read): Use ngettext()
7296         (new_volume): use quote().
7297         * src/create.c: Use quote()
7298         * src/extract.c: Likewise
7299         * src/xheader.c: Likewise
7300         * src/misc.c: Add comments to translators
7301
7302         * tests/same-order01.at: sort ls output
7303         * tests/sparse01.at (RE_CHECK): Added missing space
7304
7305         * tests/sparse02.at: Test extracting sparse files over a pipe.
7306         * tests/Makefile.am: Added sparse02.at
7307         * tests/testsuite.at: Likewise
7308         * tests/listed02.at: Skip the test on filesystems that do not
7309         update ctime of a file when renaming it. To be reverted when
7310         the new incremental mode is ready.
7311         * tests/sparse01.at: Extract and compare sparse file
7312
7313 2005-02-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7314
7315         * src/sparse.c: Extract sparse files even if the output
7316         fd is not seekable.
7317
7318 2005-02-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7319
7320         * bootstrap: Add a comment to lib/Makefile.am saying that this
7321         is an autogenerated file.
7322         Exit with code 1 if any of autotools fails.
7323         * lib/Makefile.tmpl: Insert Emacs magic to the first line.
7324         * tests/Makefile.am: Add append.at
7325
7326         * m4/.cvsignore: Ignore all *.m4 files
7327
7328 2005-01-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7329
7330         Rewritten handling of -T (--files-from) option. Now it
7331         inserts the file names immediately into argv array which allows
7332         for:
7333         1) any valid tar options (including another -T) to be used in the file
7334         2) any number of -T options to be given in command line
7335
7336         * configure.ac: Raised version number to 1.15.2
7337         * src/common.h: Include obstack.h
7338         (files_from_option): Removed
7339         (unquote_option): New variable
7340         (stat_fatal): New function
7341         (name_close): Removed function.
7342         * src/incremen.c: Remove inclusion of obstack.h
7343         * src/xheader.c: Likewise.
7344         * src/misc.c (stat_fatal): New function
7345         * src/names.c (name_file): Removed variable.
7346         (read_name_from_file): Removed function. All callers changed.
7347         (name_close): Removed function. All callers changed.
7348         * src/tar.c: New options --unquote (--no-unquote) and
7349         --add-file
7350         (add_file_id,read_name_from_file,update_argv): New functions
7351         (parse_opt): Rewritten handling of -T option. Handle hidden
7352         --HANG option for debugging purposes.
7353         (decode_options): Init unquote_option to true. Init argv_stk.
7354         Remove unneeded references to files_from_option
7355
7356         * doc/tar.texi: Document new options.
7357         Moved rendition macros and option value definitions into
7358         separate files
7359         * doc/rendition.texi: New file
7360         * doc/value.texi: New file
7361         * doc/Makefile.am: Updated
7362
7363 2005-01-13  Paul Eggert  <eggert@cs.ucla.edu>
7364
7365         * tests/testsuite.at (RE_CHECK): Use "join - file", not
7366         "join file -", to work around a bug in Solaris 8 join.
7367         Problem reported by Tomohiro Suzuki.
7368
7369 2005-01-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7370
7371         * src/list.c (read_header): Fixed calculation of the
7372         size for GNU long name/link. Tar was reading one block
7373         more if name_size was divisible by 512. Thanks Josef
7374         Bauer.
7375         * tests/long01.at: New file. Test listing of GNU long names
7376         divisible by 512.
7377         * tests/pipe.at: Sort tar output.
7378         * tests/Makefile.am: Added long01.at
7379         * tests/testsuite.at: Likewise.
7380         * THANKS: Added Josef Bauer
7381         * lib/.cvsignore: Updated
7382         * m4/.cvsignore: Updated
7383         * NEWS: Updated
7384
7385 2005-01-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7386
7387         * directory: Updated for 1.15.1
7388         * doc/Makefile.am: Use gendocs.sh to generate web documentation
7389         * doc/gendocs_template: Template file for gendocs.sh
7390         * doc/tar.texi: Updated docs for --[no-]same-permissions
7391         * src/tar.c: Reworded docstrings for --[no-]same-permissions
7392
7393 2005-01-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7394
7395         * bootstrap: Create m4/paxutils.m4
7396         * configure.ac: Call tar_PAXUTILS
7397         * tests/options02.at: Test that tar correctly handles non-option
7398         arguments interspersed with options.
7399         * tests/Makefile.am: Add options02.at
7400         * tests/testsuite.at: Likewise
7401         * tests/listed02.at: Do not create useless directory
7402
7403 2005-01-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7404
7405         * src/tar.c (parse_opt): Bugfix: Use ARGP_KEY_ARG. Thanks
7406         Mike Frysinger <vapier@gentoo.org> for reporting.
7407
7408 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
7409
7410         * lib/Makefile.tmpl (localedir.h): Omit needless quotes and a
7411         needless sed command.  Problem reported by Paul Jarc.
7412
7413 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
7414
7415         Accommodate latest gnulib.
7416         * doc/.cvsignore: Add getdate.texi.
7417         * bootstrap: Do not treat alloca-opt specially; this is no
7418         longer needed (and breaks builds) with latest gnulib.
7419
7420 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7421
7422         * src/tar.c (main): Reverted recent changes (#ifdef).
7423
7424 2004-12-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7425
7426         * configure.ac: Raise version number to 1.15.1
7427         Check for locale.h
7428         * NEWS: Entry for 1.15.1
7429         * src/buffer.c: Bugfix. Changes introduced 2004-11-26
7430         broke extraction from stdin.
7431         * src/list.c (from_header, tar_checksum): Changed declaration.
7432         All callers updated.
7433         * src/common.h: Likewise
7434         * src/tar.c (main): Protect invocation of setlocale by
7435         ifdef.
7436
7437         * tests/comprec.at: New test
7438         * tests/pipe.at: New test
7439         * tests/Makefile.am (comprec.at,pipe.at): New tests
7440         * tests/testsuite.at: Likewise
7441         * tests/gzip.at: Use AT_GZIP_PREREQ
7442         * tests/star/pax-big-10g.at: Likewise
7443         * tests/star/ustar-big-2g.at: Likewise
7444         * tests/star/ustar-big-8g.at: Likewise
7445
7446         * tests/extrac04.at: Discard stderr from sort, on some
7447         systems it spits out lots of irrelevant info.
7448         * tests/listed02.at: Likewise
7449
7450         * doc/index.html.in: Rewritten in xhtml to follow recent
7451         GNU site standards.
7452         * THANKS: Updated
7453
7454 2004-12-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7455
7456         Released version 1.15. Sources up to this point are
7457         tagged release_1_15.
7458
7459         * configure.ac: Raised version number to 1.15
7460         * NEWS: Likewise
7461         * directory: Updated
7462         * bootstrap (update_po): Give -r to wget. Always remove index.html
7463         Ignore alloca-opt module (it duplicates alloca)
7464
7465         * tests/Makefile.am: Distribute star/quicktest.sh
7466         * tests/star/README: Document quicktest.sh
7467         * tests/star/qucktest.sh: Removed.
7468         * tests/star/quicktest.sh: New file.
7469
7470 2004-12-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7471
7472         * NEWS: Updated
7473         * doc/tar.texi: Document auto-detection of compressed archive
7474         formats.
7475         * src/tar.c (decode_options): Ignore --seek if used with --delete.
7476         Delete.c is based on the assumption that the archive is being
7477         actually read, not lseeked.
7478
7479         * tests/delete05.at: New file
7480         * tests/extrac02.at: Fixed typo in AT_SETUP
7481         * tests/Makefile.am: Added delete05.at
7482         * tests/testsuite.at: Likewise.
7483
7484 2004-12-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7485
7486         * src/delete.c (delete_archive_members): Bugfix: when
7487         attempting to delete an nonexistent member, the last
7488         blocking_factor blocks were zeroed.
7489
7490 2004-12-14  Paul Eggert  <eggert@cs.ucla.edu>
7491
7492         * TODO: Mention sub-second resolution, lutimes, lchmod.
7493
7494 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
7495
7496         Adjust to recent gnulib changes.
7497         * doc/getdate.texi: Remove, since bootstrap gets it from gnulib now.
7498         * .cvsignore: Add rmt, rmt/*, rmt/*/*.
7499         * lib/.cvsignore: Add allocsa.c, allocsa.h, allocsa.valgrind,
7500         charset.alias, config.charset, getcwd.c, getcwd.h, localcharset.c,
7501         localcharset.h, ref-add.sed, ref-add.sin, ref-del.sed,
7502         ref-del.sin, setenv.c, setenv.h, unsetenv.c.  Remove pathmax.h,
7503         xstrdup.c.
7504         * m4/.cvsignore: Add allocsa.m4, eealloc.m4, getcwd-path-max.m4,
7505         localcharset.m4, realloc.m4, setenv.m4.  Remove malloc.m4,
7506         pathmax.m4, realloc.m4.
7507
7508 2004-11-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7509
7510         * configure.ac: Raised version number to 1.14.91
7511         * scripts/tarcat: New file
7512         * scripts/Makefile.am: Added tarcat
7513         * src/buffer.c (hit_eof): Changed type to boolean
7514         (read_full_records,reading_from_pipe): New variables
7515         (check_compressed_archive,open_compressed_archive): New functions
7516         (open_archive): Autodetect compressed archives and act accordingly.
7517         Set reading_from_pipe. This fixes controversial set of changes
7518         introduced 2004-05-11,2004-03-22.
7519         * src/list.c (tar_checksum): New function
7520         (read_header): Use tar_checksum().
7521         * src/common.h (tar_checksum): New function
7522
7523         * tests/star/README: Updated
7524         * NEWS: Updated
7525         * PORTS: Updated
7526
7527 2004-11-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7528
7529         * src/tar.c (decode_options): Fixed -o semantics. Thanks
7530         Jean Delvare <khali@linux-fr.org>
7531
7532 2004-10-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7533
7534         * bootstrap: Add localcharset
7535         * lib/Makefile.tmpl: Initialize SUFFIXES and CLEANFILES since the
7536         makefile snippet from localcharset uses '+=' on them.
7537         * src/Makefile.am (LDADD): Add LIBICONV
7538         * src/list.c (decode_header): Set uname/gname to NULL if their
7539         header counterparts are empty
7540         * src/tar.c (options): Use OPTION_NO_TRANS
7541         * src/utf8.c: Use locale_charset() from gnulib
7542
7543         * tests/star/README: Updated
7544
7545         * NEWS: Updated
7546         * TODO: Minor fix
7547
7548 2004-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7549
7550         * THANKS: Added Bryan Ford
7551         * doc/Makefile.am (.text): Fixed rule
7552         * po/POTFILES.in: Added argp-help.c
7553
7554 2004-10-04  Bryan Ford  <baford@mit.edu>
7555
7556         * src/tar.c: New option --exclude-caches, to exclude
7557         cache directories automatically on archive creation.
7558         Cache directories are directories containing a
7559         standardized tag file, as specified at:
7560                 http://www.brynosaurus.com/cachedir/spec.html
7561         * src/common.h: New variable exclude_caches_option.
7562         * src/create.c: New function check_cache_directory(),
7563         called from dump_dir0() if exclude_caches_option is set,
7564         to check for a cache directory tag and exclude the directory
7565         if such a tag is found.
7566         * doc/tar.texi: Updated accordingly.
7567
7568 2004-09-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7569
7570         * doc/tar.texi: Minor fix
7571         * src/tar.c (options): Minor fix
7572
7573 2004-09-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7574
7575         * TODO: Updated
7576         * lib/Makefile.tmpl: Added 'rtapelib.o: localedir.h' dependency
7577         * src/common.h: Comment WANT_DIRECTORY_REMOVE_OPTION.
7578         * src/extract.c: Normalized use of remove_any_file().
7579         * src/misc.c: Likewise.
7580         * src/tar.c (parse_opt): Emit warning if -l option is used.
7581         (show_default_settings): REMOTE_SHELL may be undefined
7582
7583 2004-09-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7584
7585         Test suite rewritten in autotest.
7586
7587         * configure.ac: Updated for autotest
7588         * src/tar.c (argp_program_version): Modified.
7589         * tests/Makefile.am: Rewritten for autotest.
7590
7591         * tests/.cvsignore: Updated
7592         * tests/append.at: New file
7593         * tests/atlocal.in: New file
7594         * tests/delete01.at: New file
7595         * tests/delete02.at: New file
7596         * tests/delete03.at: New file
7597         * tests/delete04.at: New file
7598         * tests/extrac01.at: New file
7599         * tests/extrac02.at: New file
7600         * tests/extrac03.at: New file
7601         * tests/extrac04.at: New file
7602         * tests/extrac05.at: New file
7603         * tests/gzip.at: New file
7604         * tests/ignfail.at: New file
7605         * tests/incremental.at: New file
7606         * tests/link01.at: New file
7607         * tests/listed01.at: New file
7608         * tests/listed02.at: New file
7609         * tests/longv7.at: New file
7610         * tests/multiv01.at: New file
7611         * tests/multiv02.at: New file
7612         * tests/multiv03.at: New file
7613         * tests/old.at: New file
7614         * tests/options.at: New file
7615         * tests/recurse.at: New file
7616         * tests/same-order01.at: New file
7617         * tests/same-order02.at: New file
7618         * tests/sparse01.at: New file
7619         * tests/testsuite.at: New file
7620         * tests/version.at: New file
7621         * tests/volume.at: New file
7622         * tests/star/gtarfail.at: New file
7623         * tests/star/gtarfail2.at: New file
7624         * tests/star/multi-fail.at: New file
7625         * tests/star/pax-big-10g.at: New file
7626         * tests/star/ustar-big-2g.at: New file
7627         * tests/star/ustar-big-8g.at: New file
7628
7629         * tests/preset.in: Removed
7630         * tests/before: Removed
7631         * tests/after: Removed
7632         * tests/version.sh: Removed.
7633         * tests/append.sh: Removed.
7634         * tests/delete01.sh: Removed.
7635         * tests/delete02.sh: Removed.
7636         * tests/delete03.sh: Removed.
7637         * tests/delete04.sh: Removed.
7638         * tests/extrac01.sh: Removed.
7639         * tests/extrac02.sh: Removed.
7640         * tests/extrac03.sh: Removed.
7641         * tests/extrac04.sh: Removed.
7642         * tests/extrac05.sh: Removed.
7643         * tests/gzip.sh: Removed.
7644         * tests/incremen.sh: Removed.
7645         * tests/ignfail.sh: Removed.
7646         * tests/link01.sh: Removed.
7647         * tests/listed01.sh: Removed.
7648         * tests/listed02.sh: Removed.
7649         * tests/longv7.sh: Removed.
7650         * tests/multiv01.sh: Removed.
7651         * tests/multiv02.sh: Removed.
7652         * tests/multiv03.sh: Removed.
7653         * tests/old.sh: Removed.
7654         * tests/options.sh: Removed.
7655         * tests/same-order01.sh: Removed.
7656         * tests/same-order02.sh: Removed.
7657         * tests/volume.sh: Removed.
7658         * tests/recurse.sh: Removed.
7659         * tests/sparse01.sh: Removed.
7660         * tests/star/gtarfail.sh: Removed.
7661         * tests/star/gtarfail2.sh: Removed.
7662         * tests/star/multi-fail.sh: Removed.
7663         * tests/star/ustar-big-2g.sh: Removed.
7664         * tests/star/ustar-big-8g.sh: Removed.
7665         * tests/star/pax-big-10g.sh: Removed.
7666
7667 2004-09-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7668
7669         * bootstrap: Install genfile.c from paxutils
7670         * tests/genfile.c: Removed. Integrated into
7671         paxutils.
7672         * tests/mksparse.c: Removed. Integrated into
7673         (paxutils) genfile.c
7674         * tests/Makefile.am: Removed mksparse
7675         * tests/sparse01.sh: Use genfile instead of mksparse
7676
7677 2004-09-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7678
7679         Started merging with cpio into paxutils. Sources before
7680         this point are tagged alpha-1_14_90
7681
7682         * Makefile.am: Updated for use with paxutils
7683         * README-alpha: Likewise
7684         * bootstrap: Likewise
7685         * configure.ac: Likewise
7686         * lib/Makefile.tmpl: Likewise
7687         * po/POTFILES.in: Likewise
7688         * src/Makefile.am: Likewise
7689         * src/buffer.c: Likewise
7690         * src/common.h: Likewise
7691         * src/compare.c: Likewise
7692         * src/create.c: Likewise
7693         * src/delete.c: Likewise
7694         * src/extract.c: Likewise
7695         * src/incremen.c: Likewise
7696         * src/list.c: Likewise
7697         * src/mangle.c: Likewise
7698         * src/misc.c: Likewise
7699         * src/names.c: Likewise
7700         * src/sparse.c: Likewise
7701         * src/system.c: Likewise
7702         * src/tar.c: Likewise
7703         * src/update.c: Likewise
7704         * src/utf8.c: Likewise
7705         * src/xheader.c: Likewise
7706
7707         * src/system.h: Removed
7708         * src/rmt.c: Removed
7709         * src/rmt.h: Removed
7710         * src/rtapelib.c: Removed
7711
7712 2004-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7713
7714         * tests/listed02.sh: Do not depend on any particular ordering
7715         of output.
7716
7717 2004-09-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7718
7719         * doc/tar.texi: Document the use of -C option in
7720         file lists. Document --seek option.
7721         * configure.ac: New option --with-rmt. New configuration variable
7722         DEFAULT_RMT_DIR. Removed DEFAULT_RMT_COMMAND.
7723         * src/Makefile.am: Install rmt into rmtdir
7724         * src/tar.c (usage): Minor fix.
7725         * NEWS: Updated.
7726         * README: Updated.
7727
7728 2004-09-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7729
7730         * configure.ac: Raised version number to 1.14.90
7731         * src/common.h (is_individual_file): New prototype
7732         * src/create.c (dump_file0): Fix bug introduced
7733         2004-02-21.
7734         * src/names.c (register_individual_file)
7735         (is_individual_file): New functions.
7736         * tests/listed01.sh: Use genfile instead of dd.
7737         * tests/listed02.sh: New file.
7738         * tests/Makefile.am: Added listed02.sh
7739
7740         * NEWS: Updated
7741
7742 2004-08-31  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7743
7744         * src/sparse.c (sparse_add_map): Fixed improper initializations
7745         of sparse_map_size. We assume that whatever number it contains
7746         describes adequately the current size of sparse_map. The only
7747         number we need to reset is sparse_map_avail.
7748         * src/compare.c (verify_volume): Call set_next_block_after
7749         if read_header returns HEADER_FAILURE
7750         Destroy and reinitialize content of current_stat_info and
7751         extended_header after each iteration (bug reported by
7752         John L. Males <jlmales@yahoo.com>).
7753         Issue a warning if the created archive contains some members
7754         whose file names were stripped off their leading prefixes.
7755         This is a temporary fix of the issue reported by Bdale Garbee
7756         <bdale@gag.com> (Refs: Debian bug 230064, Message-Id
7757         <87n07kyzhi.fsf@rover.gag.com>, Sun, 15 Feb 2004 11:22:17 -0700)
7758
7759         * src/names.c (removed_prefixes_p): New function.
7760
7761         * src/buffer.c: When computing write rate do not take
7762         into account the time needed to verify the archive(s).
7763         The bug reported by John L. Males <jlmales@yahoo.com>
7764         (set_start_time,compute_duration): New functions.
7765         (print_total_written): Use the result of compute_duration().
7766         (close_archive): Call compute_duration.
7767         * src/common.h (set_start_time, removed_prefixes_p): New prototypes.
7768         * src/list.c (decode_header): Fixed initialization
7769         of stat_info->is_sparse
7770         * src/tar.c (main): Call set_start_time().
7771
7772         * src/misc.c (unquote_string): Unquote '\a' and '\v'.
7773         Reported by Helmut Waitzmann <helmut.waitzmann@web.de>.
7774
7775         * NEWS: Updated
7776         * THANKS: Updated
7777
7778 2004-08-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7779
7780         * src/tar.c: Fix copy-n-paste errors in the license
7781
7782 2004-08-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7783
7784         * scripts/backup.in: Renamed LIBPATH to LIBDIR.
7785         Use ROOT_FS with -C option. Do not send mail
7786         if ADMINISTRATOR is set to NONE.
7787         * scripts/backup.sh.in (test_root): Append / to
7788         ROOT_FS if it does not already end in it.
7789         * scripts/restore.in: Renamed LIBPATH to LIBDIR.
7790         New option -a (--all). Do not start restore unless
7791         -a or patterns are given.
7792         (restore_fs,restore_files): Fixed use of --listed option.
7793         * doc/tar.texi: Updated
7794         * NEWS: Updated
7795
7796 2004-08-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7797
7798         * src/tar.c (find_argp_option): Fixed typo
7799
7800 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
7801
7802         Merge argp, getopt, xalloc changes from gnulib.
7803         * bootstrap (gnulib_modules): Add xalloc-die.
7804         Remove code to test for patches; we don't have patches now.
7805         Set LC_ALL=C so that file names sort consistently.
7806         Prefer the gnulib copies of gettext.m4, glibc21.m4,
7807         lib-ld.m4, lib-prefix.m4, po.m4 too.
7808
7809         * patches/getopt.diff: Remove; gnulib now works unpatched.
7810         * configure.ac (_getopt_long_only_r): Remove check.
7811         gl_ARGP now does this for us.
7812         * lib/.cvsignore: Add fnmatch.h, getopt_.h, sysexit.h,
7813         xalloc-die.c.
7814         * src/extract.c: Adjust to changes to gnulib xalloc module.
7815         (extr_init): Remove assignment to xalloc_fail_func; no longer needed.
7816         (xalloc_die): New function.
7817
7818 2004-08-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7819
7820         * NEWS: Updated
7821
7822         * src/buffer.c (flush_write): Limit filenames
7823         of the members that straddle multivolume archive
7824         boundary to 100 characters.
7825         (flush_read): Use strncmp when comparing multivolume member
7826         names.
7827         * tests/multiv03.sh: New file
7828         * tests/Makefile.am: Added multiv03.sh
7829
7830 2004-08-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7831
7832         * src/list.c (read_and): Call decode_header before
7833         calling skip_member()
7834         (skip_member): Use is_sparse field to determine if the
7835         member is a sparse file.
7836
7837         * tests/Makefile.am: Added extrac05.sh
7838         * tests/extrac05.sh: New file
7839         * tests/append.sh: Rearranged leading comments. Added explicit
7840         references to report messages wherever available.
7841         * tests/delete01.sh: Likewise
7842         * tests/delete02.sh: Likewise
7843         * tests/delete03.sh: Likewise
7844         * tests/delete04.sh: Likewise
7845         * tests/extrac01.sh: Likewise
7846         * tests/extrac02.sh: Likewise
7847         * tests/extrac03.sh: Likewise
7848         * tests/extrac04.sh: Likewise
7849         * tests/gzip.sh: Likewise
7850         * tests/ignfail.sh: Likewise
7851         * tests/incremen.sh: Likewise
7852         * tests/link01.sh: Likewise
7853         * tests/listed01.sh: Likewise
7854         * tests/longv7.sh: Likewise
7855         * tests/multiv01.sh: Likewise
7856         * tests/multiv02.sh: Likewise
7857         * tests/old.sh: Likewise
7858         * tests/options.sh: Likewise
7859         * tests/recurse.sh: Likewise
7860         * tests/same-order01.sh: Likewise
7861         * tests/same-order02.sh: Likewise
7862         * tests/sparse01.sh: Likewise
7863         * tests/version.sh: Likewise
7864         * tests/volume.sh: Likewise
7865
7866 2004-08-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7867
7868         * bootstrap: Extended --update-po option to take an
7869         optional argument specifying the po file to update.
7870         * src/create.c: Improved compatibility with 1.13.25
7871         * tests/link01.sh: New file.
7872         * tests/Makefile.am: Added link01.sh
7873
7874 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
7875
7876         Merge from gnulib.
7877
7878         * patches/argp.diff: Remove; no longer needed.
7879
7880         * lib/.cvsignore: Add stat-macros.h.
7881         Remove addext.c, malloc.c, realloc.c.
7882
7883         * src/extract.c: Include <getcwd.h>.
7884         (extract_archive): Rewrite with new macro IS_ABSOLUTE_FILE_NAME.
7885         * src/extract.c (make_directories):
7886         FILESYSTEM_PREFIX_LEN -> FILE_SYSTEM_PREFIX_LEN.
7887         * src/misc.c (must_be_dot_or_slash): Likewise.
7888         * src/names.c (excluded_name, safer_name_suffix, stripped_prefix_len):
7889         Likewise.
7890         * src/tar.c (parse_opt): Likewise.
7891         * src/incremen.c (purge_directory): Fix format buffer typos in warning
7892         strings.
7893         * src/tar.c (options): Add missing initializers to pacify gcc.
7894         (decode_options): Remove unused var.
7895
7896 2004-08-02  Paul Eggert  <eggert@cs.ucla.edu>
7897
7898         * bootstrap (gnulib_modules): Add getpagesize.
7899         * configure.ac (valloc): Remove check; valloc no longer used.
7900         * lib/.cvsignore: Add getpagesize.h.
7901         * m4/.cvsignore: Add getpagesize.m4.
7902         * src/buffer.c (record_buffer): New var.
7903         (open_archive): Don't use valloc; on older or buggy hosts, you can't
7904         free the result.  Use page_aligned_alloc instead.
7905         * src/compare.c (diff_init): Likewise.
7906         * src/buffer.c (open_archive): Record the pointer to be freed
7907         into record_buffer.
7908         (close_archive): Free record_buffer.
7909         * src/common.h (page_aligned_alloc): New decl.
7910         * src/misc.c (quote_n, quote): Remove these redundant functions.
7911         (ptr_align): New function, from coreutils/src/system.h.
7912         (page_aligned_alloc): New function.
7913         * src/system.h (valloc): Remove.
7914
7915 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
7916
7917         * src/extract.c (extract_archive): Do not report an error
7918         when hard-linking X to X when X exists.  Problem reported by
7919         Toby Peterson.
7920         * lib/.cvsignore: Add fchown-stub.c.
7921
7922 2004-06-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7923
7924         * NEWS: Updated
7925         * src/common.h (root_device): New global.
7926         (gnu_restore): Renamed to purge_directory().
7927         * src/extract.c (extr_init): Save the device number
7928         of the root device.
7929         (extract_archive): Renamed gnu_restore() to purge_directory().
7930         * src/incremen.c (gnu_restore): Renamed to purge_directory().
7931         Do not attempt to purge the directory if it is on a different
7932         device and one_file_system_option is set.
7933
7934 2004-06-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7935
7936         * doc/tar.texi: The actual default for exclude patterns
7937         is --no-anchored. Fixed.
7938         * src/tar.c (options): Likewise.
7939         Thanks "Felix Natter" <felix.natter@ldc.de> for noticing.
7940
7941 2004-06-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7942
7943         * doc/tar.texi: Fixed several inconsistencies.
7944         * src/tar.c: Fixed docstring for --checkpoint option.
7945
7946 2004-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7947
7948         * src/buffer.c (seek_archive): New function
7949         * src/common.h (seek_archive): New function
7950         (seekable_archive): New global.
7951         * src/list.c (skip_file): Use seek_archive() if
7952         possible.
7953         * src/tar.c (struct fmttab): Accept 'pax' as alias
7954         for 'posix'
7955         (options): New option -n (--seek).
7956         * src/update.c: Determine type of the archive before
7957         appending to it.
7958
7959         * TODO: Updated.
7960
7961 2004-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7962
7963         * bootstrap: New option --update-po
7964         * src/tar.c: New option -H (short alias to --format)
7965         * doc/tar.texi: Document -H option
7966         * src/names.c (safer_name_suffix): Fixed bug introduced
7967         2004-05-11.
7968
7969 2004-05-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7970
7971         * bootstrap: Apply patches from patch subdirectory
7972         * patches: New dir
7973         * patches/argp.diff: New file
7974         * patches/getopt.diff: New file
7975         * configure.ac: Check for _getopt_long_only_r and
7976         force using included version of getopt if the function
7977         is not available.
7978         * src/tar.c: Use argp for command line parsing.
7979         * src/system.h: Minor formatting fix
7980         * m4/.cvsignore: Updated
7981         * lib/.cvsignore: Updated
7982         * doc/tar.texi: Minor fix.
7983         * src/extract.c: Fix improper use of 'path' term
7984         * src/incremen.c: Likewise
7985         * src/list.c: Likewise
7986         * src/misc.c: Likewise
7987         * src/names.c: Likewise
7988         * src/rmt.h: Likewise
7989         * src/rtapelib.c: Likewise
7990         * src/update.c: Likewise
7991         * src/xheader.c: Likewise
7992         * tests/star/README: Minor fix
7993
7994 2004-05-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
7995
7996         * configure.ac: Raised version number to 1.14.1
7997         * src/tar.c: Renamed --strip-path to --strip-components
7998         Changed improper use of _() to ngettext().
7999         * src/extract.c: Renamed strip_path_option to strip_components_option
8000         * src/common.h: Likewise.
8001         * NEWS: Updated.
8002         * doc/tar.texi: Updated
8003
8004 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8005
8006         * src/system.c (sys_child_open_for_uncompress): Do not
8007         set read_full_records_option: the compressed archive is
8008         likely not to contain integer number of records. Should
8009         the user wish to use reblocking, he may always give tar
8010         -B option. This is a minor improvement over the change
8011         dated 2004-03-22.
8012         * src/buffer.c (open_archive): Removed assignment to
8013         read_full_records_option.
8014
8015         * src/names.c (safer_name_suffix): (safer_name_suffix): Use "%s"
8016         as the format argument, rather than a possibly-translated variable
8017         string. Patch provided by Jim Meyering  <jim@meyering.net>
8018         * src/tar.c (decode_options): Fixed typo in the comment.
8019         * tests/star/README: Minor correction
8020
8021 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8022
8023         * directory: New file. GNU directory entry for tar.
8024         * doc/Makefile.am: Rewritten. Added rules for generating
8025         documentation for the project's website.
8026         * doc/.cvsignore: Updated
8027         * doc/index.html.in: New file.
8028
8029 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8030
8031         * configure.ac: Raised version number to 1.14
8032         * NEWS: Updated.
8033         * tests/after: Added copyleft statement
8034         * tests/before: Added copyleft statement
8035         * tests/preset.in: Added copyleft statement
8036
8037         Tar 1.14 is released. Sources up to this point are tagged
8038         release_1_14
8039
8040 2004-05-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8041
8042         * configure.ac: Fixed prerequisite headers for sys/buf.h
8043         (needed on FreeBSD)
8044         * src/system.h: Likewise.
8045         * tests/after (compare): Fixed argument quoting under eval
8046         * tests/before: Quote TAR_ARCHIVE_FORMATS
8047
8048 2004-05-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8049
8050         * NEWS: Updated
8051         * README: Updated
8052         * PORTS: Updated
8053         * configure.ac: Call gl_AC_TYPE_INTMAX_T. Document
8054         DEFAULT_.* variables. Use DEFAULT_RMT_COMMAND to set
8055         the pathname of the rmt utility.
8056         New option --enable-backup-scripts.
8057         * doc/tar.texi: Updated
8058         * scripts/Makefile.am: Install the scripts only if requested
8059         by the configure.
8060         * scripts/backup.in: Fixed --version output.
8061         Fixed initialization of the listing files and printing
8062         the time of the last previous level dump.
8063         * scripts/restore.in: Fixed --version output.
8064         * src/Makefile.am (localedir.h rule): Generate correct
8065         DEFAULT_RMT_COMMAND variable.
8066         * src/common.h (rmt_command_option): New variable.
8067         * src/list.c (read_and): Print block number before
8068         issuing 'Skipping to next header' diagnostics, if
8069         requested by block_number_option.
8070         * src/rtapelib.c: Use rmt_command_option instead of
8071         hardcoded "/etc/rmt".
8072         * src/tar.c: New option --rmt-command.
8073         (decode_options): Handle --rmt-command. Initialize
8074         rmt_command_option to DEFAULT_RMT_COMMAND.
8075
8076 2004-05-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8077
8078         * doc/tar.texi: Further update.
8079
8080 2004-05-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8081
8082         * configure.ac: Minor fix
8083         * scripts/Makefile.am: Updated
8084         * scripts/backup-specs: Updated
8085         * scripts/backup.in: Minor fixes
8086         * scripts/backup.sh: Removed
8087         * scripts/backup.sh.in: New file. Source for backup.sh
8088         * scripts/restore.in: New file
8089         * scripts/.cvsignore: Updated
8090         * scripts/WARNING: Removed
8091         * doc/tar.texi: Updated
8092         * NEWS: Updated
8093
8094 2004-05-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8095
8096         * src/names.c (name_gather): Bugfix: Honor single -C with
8097         --same-order.
8098         * tests/same-order01.sh: New file
8099         * tests/same-order02.sh: New file
8100         * tests/Makefile.am: Updated
8101
8102         * tests/append.sh: Added copyleft header
8103         * tests/delete01.sh: Likewise
8104         * tests/delete02.sh: Likewise
8105         * tests/delete04.sh: Likewise
8106         * tests/extrac01.sh: Likewise
8107         * tests/extrac02.sh: Likewise
8108         * tests/extrac03.sh: Likewise
8109         * tests/extrac04.sh: Likewise
8110         * tests/gzip.sh: Likewise
8111         * tests/ignfail.sh: Likewise
8112         * tests/incremen.sh: Likewise
8113         * tests/multiv01.sh: Likewise
8114         * tests/old.sh: Likewise
8115         * tests/options.sh: Likewise
8116         * tests/recurse.sh: Likewise
8117         * tests/version.sh: Likewise
8118         * tests/volume.sh: Likewise
8119         * tests/star/gtarfail.sh: Likewise
8120         * tests/star/gtarfail2.sh: Likewise
8121         * tests/star/multi-fail.sh: Likewise
8122         * tests/star/pax-big-10g.sh: Likewise
8123         * tests/star/qucktest.sh: Likewise
8124         * tests/star/ustar-big-2g.sh: Likewise
8125         * tests/star/ustar-big-8g.sh: Likewise
8126
8127         * doc/.cvsignore: Updated
8128
8129 2004-05-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8130
8131         * configure.ac: Check whether date accepts +format argument
8132         (for backup scripts).
8133         * scripts/level-0: Removed
8134         * scripts/level-1: Removed
8135         * scripts/weekly.new: Removed
8136         * scripts/dump-remind: Removed
8137         * scripts/backup.in: New file
8138         * scripts/backup.sh: New file
8139         * scripts/dump-remind.in: New file
8140         * scripts/backup-specs: Updated
8141         * scripts/Makefile.am: Updated for new directory contents.
8142         * scripts/.cvsignore: Updated
8143
8144 2004-05-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8145
8146         * TODO: Updated
8147         * doc/tar.texi: Updated
8148         * src/tar.c: --utc implies -vv
8149
8150 2004-04-28  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8151
8152         * src/utf8.c: Make sure ICONV_CONST is defined. AM_ICONV
8153         does not define it if it fails to find iconv.h.
8154
8155 2004-04-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8156
8157         * bootstrap: Use gnulib-tool to generate lib/Makefile.am
8158         and parts of configure.ac
8159         * configure.ac: Invoke tar_GNULIB to configure gnulib stuff.
8160         * lib/Makefile.am: Removed
8161         * lib/Makefile.tmpl: New file.
8162         * lib/.cvsignore: Updated
8163         * m4/.cvsignore: Updated
8164         * src/xheader.c: Include stpcpy.h
8165
8166         * src/create.c: Produce an error, not warning, if the
8167         filename is too long.
8168         * tests/longv7.sh: Synchronized with the recent changes.
8169
8170 2004-04-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8171
8172         * configure.ac: Fixed test for iconv_t
8173         * src/rmt.h: Bugfix by Jürgen Weigert
8174         * THANKS: Add Jürgen Weigert
8175         * tests/star/README: Fixed typo
8176
8177 2004-04-04  Paul Eggert  <eggert@twinsun.com>
8178
8179         Merge getdate documentation changes from coreutils.
8180
8181         * doc/getdate.texi: Update from coreutils CVS.
8182         * doc/tar.texi: Fix getdate menu to match getdate.texi's.
8183
8184         Merge recent gnulib changes, and remove some lint.
8185
8186         Improve support for nanosecond-resolution time stamps.
8187         * bootstrap: Add gettime, timespec modules.
8188         * configure.ac (gl_GETTIME, gl_TIMESPEC): Add.
8189         * lib/.cvsignore (getopt_int.h, gettime.c, gettimeofday.c,
8190         timespec.h): Add.
8191         * lib/Makefile.am (libtar_a_SOURCES): Add gettime.c, timespec.h.
8192         * m4/.cvsignore: Add clock_time.m4, gettime.m4, gettimeofday.m4,
8193         st_mtim.m4, timespec.m4.  Remove malloc.m4, realloc.m4.
8194         * src/common.h (newer_mtime_option): Now a struct timespec, not
8195         time_t.  All uses changed.
8196         (NEWER_OPTION_INITIALIZED, OLDER_STAT_MTIME): New macros.
8197         * src/create.c (dump_file0): Use OLDER_STAT_TIME to compare times.
8198         * src/incremen.c (scan_path): Likewise.
8199         * src/list.c (read_and): Likewise.
8200         * src/list.c (read_and): Use NEWER_OPTION_INITIALIZED to decide
8201         whether newer_mtime_option is initialized.
8202         * src/tar.c (decode_options): Likewise.
8203         * src/tar.c (decode_options): Adjust to new signature for get_date.
8204
8205         * src/buffer.c (short_read, flush_read): Use size_t, not ssize_t, for
8206         result of safe_read, full_write, and similar functions.
8207         Detect safe_read error by comparing to SAFE_READ_ERROR;
8208         detect full_write error by comparing to 0.
8209         All uses changed.
8210         * src/common.h (write_error_details, sys_write_archive_buffer):
8211         Likewise.
8212         * src/misc.c (write_error_details): Likewise.
8213         * src/rmt.c (main): Likewise.
8214         * src/rmt.h (rmt_read__, rmt_write__): Likewise.
8215         * src/rtapelib.c (rmt_read__, rmt_write__, rmt_ioctl__): Likewise.
8216         * src/sparse.c (sparse_scan_file, sparse_dump_region,
8217         check_sparse_region, check_data_region): Likewise.
8218         * src/system.c (sys_write_archive_buffer, sys_drain_input_pipe,
8219         sys_child_open_for_compress, sys_child_open_for_uncompress): Likewise.
8220         * src/update.c (append_file): Likewise.
8221
8222         * src/buffer.c (clear_read_error_count): Use explicit (void)
8223         to indicate a function with no arguments.
8224         * src/create.c (check_links): Likewise.
8225         * src/system.c (sys_get_archive_stat, sys_save_archive_dev_ino,
8226         sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell,
8227         sys_reset_uid_gid, sys_get_archive_stat, sys_save_archive_dev_ino,
8228         sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell):
8229         Likewise.
8230         * src/utf8.c (get_input_charset): Likewise.
8231         * src/xheader.c (xheader_ghdr_name, xheader_write_global,
8232         xheader_decode_global, extended_header_init): Likewise.
8233         * tests/mksparse.c (usage): Likewise.
8234
8235         * src/buffer.c (new_volume): Rename local variables to avoid
8236         shadowing warnings.
8237         * src/common.h (file_dumpable_p, sys_stat_nanoseconds,
8238         sparse_file_p, sparse_member_p, sparse_fixup_header,
8239         sparse_dump_file, sparce_extract_file, sparse_skip_file,
8240         sparse_diff_file): Likewise.
8241         * src/compare.c (diff_archive): Likewise.
8242         * src/create.c (file_dumpable_p, dump_regular_file, dump_dir0,
8243         dump_dir, dump_hard_link, file_count_links, dump_file0, dump_file):
8244         Likewise.
8245         * src/extract.c (repair_delayed_set_stat): Likewise.
8246         * src/misc.c (maybe_backup_file, add_hierarchy_to_namelist):
8247         Likewise.
8248         * src/sparse.c (struct tar_sparse_optab, tar_sparse_dump_region,
8249         tar_sparse_extract_region, sparse_dump_region, sparse_extract_region,
8250         sparse_dump_file, sparse_file_p, sparse_member_p,
8251         sparse_fixup_header, sparse_extract_file, sparse_skip_file,
8252         check_data_region, sparse_diff_file): Likewise.
8253         * src/system.c (sys_stat_nanoseconds): Likewise.
8254         * src/xheader.c (xheader_format_name): Likewise.
8255
8256         * src/common.h (enum old_files): Remove comma before }; not portable.
8257
8258         * src/common.h (read_fatal_details): Add __attribute__ ((noreturn)).
8259         * src/rmt.c (usage): Likewise.
8260         * src/xheader.c (xheader_set_single_keyword): Likewise.
8261         * tests/genfile.c (usage): Likewise.
8262         * tests/mksparse.c (die, usage): Likewise.  Also add printf attribute
8263         to die.
8264
8265         * src/common.h (gname_to_gid, uname_to_uid): Add const to avoid
8266         some gcc warnings.
8267         * src/names.c (uname_to_uid, gname_to_gid): Likewise.
8268         * src/utf8.c (struct langtab.lang, struct langtab.terr, struct
8269         langtab.charset, charset_lookup): Likewise.
8270
8271         * src/common.h (name_init): Remove unused args.  All callers changed.
8272         * src/names.c (name_init): Likewise.
8273
8274         * src/common.h (usage, xheader_write, xheader_write_global,
8275         sys_reset_uid_gid): New decls.
8276
8277         * src/compare.c (report_difference, process_noop): Add
8278         __attribute__ ((unused)) for unused attributes.
8279         * src/sparse.c (oldgnu_sparse_member_p, star_sparse_member_p):
8280         Likewise.
8281         * src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
8282         gid_coder, gname_coder, linkpath_coder, ctime_coder, mtime_coder,
8283         path_coder, size_coder, uid_coder, uname_coder,
8284         sparse_numblocks_coder): Likewise.
8285
8286         * src/create.c (dump_regular_finish, dump_dir0, dump_dir,
8287         dump_file0): Now static.
8288         * src/utf8.c (charset_lookup): Likewise.
8289         * src/xheader.c (xheader_protected_pattern_p,
8290         xheader_protected_keyword_p, xheader_set_single_keyword,
8291         xheader_keyword_deleted_p, xheader_keyword_override_p,
8292         xheader_list_append, xheader_list_destroy, xheader_set_keyword_equal):
8293         Likewise.
8294         * tests/genfile.c (usage): Likewise.
8295         * tests/mksparse.c (die, mkhole, mksparse, usage, xlat_suffix):
8296         Likewise.
8297
8298         * src/create.c (hash_link): Rewrite to avoid cast.
8299
8300         * src/extract.c (file_newer_p): Use parameter, not global var.
8301         * src/misc.c (write_error_details): Likewise.
8302
8303         * src/extract.c (prepare_to_extract): Remove directory arg; not
8304         used.  All callers changed.
8305
8306         * src/misc.c (close_fatal): Remove; not used.
8307         * src/system.c (sys_utimes): Likewise.
8308
8309         * src/rmt.c (get_string): Avoid buffer overrun (off by 1 error).
8310
8311         * src/rmt.c (main): Update copyright date to 2004.
8312         * src/tar.c (decode_options): Likewise.
8313
8314         * src/rtapelib.c (get_status_string): Don't lose errno when
8315         skipping the error messages.
8316         (get_status): Report an error if atol returns a negative number.
8317
8318         * src/utf8.c (struct langtab, langtab, charset_lookup,
8319         get_input_charset) [!defined HAVE_LIBCONV]: Omit unused
8320         definitions.
8321         (iconv_open, iconv, iconv_close) [!defined HAVE_LIBCONV]:
8322         Use macros, not definitions, to avoid type clashes with system
8323         headers.
8324         (charset_lookup): Local var is now auto, not static.
8325         (utf8_convert): Use ICONV_CONST instead of const, to avoid
8326         type clashes.
8327
8328         * src/utf8.c (langtab): Initialize all elements of struct, to
8329         avoid gcc warning.
8330         * src/xheader.c (xhdr_tab): Likewise.
8331
8332         * src/xheader.c: Include fnmatch.h, since we use fnmatch.
8333
8334         * tests/mksparse.c (mkhole): Fix typo: bool was assigned to off_t.
8335
8336 2004-04-04  Sergey Poznyakoff  <gray@Noldor.runasimi.org>
8337
8338         * NEWS: Updated
8339         * configure.ac: Raised version number to 1.13.94
8340         * src/system.h: Protect inclusion of <sys/time.h>
8341         by ifdef.
8342         Declare time() if HAVE_DECL_TIME is 0
8343         * tests/.cvsignore: Added mksparse
8344
8345         * tests/sparse01.sh: New file
8346         * tests/multiv02.sh: New file
8347         * tests/Makefile.am: Add sparse01.sh and multiv02.sh
8348         * tests/longv7.sh: Added missing call to 'after'
8349
8350         * src/common.h: Added missing prototypes
8351         * src/compare.c (diff_archive): Use is_sparse member
8352         instead of GNUTYPE_SPARSE.
8353         * src/create.c: Removed unused variables
8354         * src/extract.c (extract_archive): Use sparse_member_p instead
8355         of GNUTYPE_SPARSE.
8356         Removed unused variables
8357         * src/list.c (decode_header): Use sparse_fixup_header to correct
8358         the st_size value.
8359         (print_header): Do not rely on GNUTYPE_SPARSE type.
8360         Use st->stat.st_size to print real file size.
8361         (skip_member): Assign stat_info.file_name to save_name. This fixes
8362         bug reported by Mads Martin Joergensen <mmj@suse.de>
8363         Use sparse_skip_file() to skip sparse members.
8364         * src/rtapelib.c: include "common.h"
8365         * src/sparse.c (struct tar_sparse_optab.sparse_member_p)
8366         (struct tar_sparse_optab.fixup_header): New member
8367         (tar_sparse_member_p): New function.
8368         (tar_sparse_init): Return true if decode_header is not provided
8369         (tar_sparse_fixup_header)
8370         (sparse_member_p,sparse_fixup_header)
8371         (sparse_skip_file)
8372         (oldgnu_sparse_member_p,oldgnu_fixup_header,star_sparse_member_p)
8373         (star_fixup_header, pax_sparse_member_p): New function
8374         (pax_decode_header): Remove
8375         * src/system.h: Include <sys/time.h> and <utime.h> when available
8376         * src/tar.c (usage): Prototype moved to common.h
8377         * src/tar.h (struct tar_stat_info.is_sparse): New member
8378         * src/utf8.c (utf8_convert): Changed prototype
8379         (get_input_charset): Removed unused variable
8380         * src/xheader.c: include <fnmatch.h>
8381         (size_decoder): Assign to both st->archive_file_size and
8382         st->stat.st_size.
8383         (st->stat.st_size): Assign to st->stat.st_size
8384         (sparse_numbytes_decoder): Removed unused variable
8385         * src/.cvsignore: Added .gdbinit
8386         * THANKS: Added Mads Martin Joergensen
8387
8388 2004-03-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8389
8390         * src/create.c (write_long_name): Do not allow more than
8391         NAME_FIELD_SIZE-1 characters in a file name for V7 format
8392         archives.
8393         * tests/longv7.sh: New file.
8394         * tests/Makefile.am: Add longv7.sh
8395
8396 2004-03-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8397
8398         * src/buffer.c (open_archive): Clear read_full_records_option
8399         if reading from a pipe.
8400         (short_read): Display warning about the deduced record size
8401         if version > 1
8402         * tests/star/pax-big-10g.sh: Updated to match the above changes.
8403         * tests/star/ustar-big-2g.sh: Likewise.
8404         * tests/star/ustar-big-8g.sh: Likewise.
8405
8406         * configure.ac: Added gl_FUNC_STRTOULL
8407         * src/create.c (start_header): Check for GNU_FORMAT
8408         if incremental_option is set.
8409         * src/xheader.c (to_decimal): New function.
8410         (xheader_format_name): Use to_decimal() instead of snprintf.
8411         * tests/listed01.sh: Use genfile instead of dd
8412         * tests/multiv01.sh: Likewise.
8413
8414 2004-03-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8415
8416         * src/list.c (read_and): Stop processing the archive after
8417         encountering a single zero record. Many old archives contain
8418         arbitrary garbage after it.
8419         The warning is issued anyway.
8420
8421 2004-03-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8422
8423         * src/rtapelib.c (rmt_lseek__,rmt_ioctl__): Bugfix. The
8424         conversion buffer was not null terminated. Fix provided
8425         by Leland Lucius <llucius@tiny.net>
8426         * THANKS: Added Leland Lucius
8427         * src/utf8.c (utf8_convert): Indentation fix.
8428
8429 2004-02-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8430
8431         * src/buffer.c (flush_read): Bugfix: the
8432         condition at line 714 included
8433
8434               || (status > 0 && !read_full_records_option)
8435
8436         which is grossly wrong, since even if new_volume() below succeeds,
8437         the subsequent call to rmtread will overwrite the chunk of data
8438         already read in the buffer and thus spoil everything.
8439         * src/system.c (sys_child_open_for_uncompress): Minor stylistic
8440         fix.
8441         * tests/star/multi-fail.sh: New test.
8442         * tests/Makefile.am: Added multi-fail.sh
8443         * tests/star/README: Updated
8444
8445 2004-02-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8446
8447         * NEWS: Updated
8448         * configure.ac: Removed spurious AC_CHECK_LIB(iconv)
8449         * src/common.h (utc_option): new global
8450         (enum old_files.KEEP_NEWER_FILES): New element
8451         * src/extract.c: Handle --keep-newer-files option
8452         * src/list.c (tartime): Print UTC if --utc was given.
8453         * src/tar.c: New options: --utc and keep-newer-files
8454
8455         * tests/Makefile.am: Added new tests
8456         * tests/after: Rewritten
8457         * tests/before: Rewritten
8458         * tests/preset.in: Rewritten
8459         * tests/delete03.sh: Accommodate for the new testsuite logic
8460         * tests/gzip.sh: Likewise
8461         * tests/incremen.sh: Likewise
8462         * tests/listed01.sh: Likewise
8463         * tests/multiv01.sh: Likewise
8464         * tests/old.sh: Likewise
8465         * tests/options.sh: Likewise
8466         * tests/version.sh: Likewise
8467         * tests/volume.sh: Likewise
8468
8469         * tests/star: New directory
8470         * tests/star/README: New file
8471         * tests/star/gtarfail.sh: New file
8472         * tests/star/gtarfail2.sh: New file
8473         * tests/star/pax-big-10g.sh: New file
8474         * tests/star/qucktest.sh: New file
8475         * tests/star/ustar-big-2g.sh: New file
8476         * tests/star/ustar-big-8g.sh: New file
8477
8478 2004-02-26  Paul Eggert  <eggert@twinsun.com>
8479
8480         * doc/tar.texi (dircategory Individual utilities): Append period,
8481         as suggested by Karl Berry.
8482
8483 2004-02-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8484
8485         * src/list.c (decode_header): Call xheader_decode before
8486         the assignment to current_stat_info.archive_file_size.
8487
8488 2004-02-23  Paul Eggert  <eggert@twinsun.com>
8489
8490         * configure.ac: Invoke AM_ICONV, to define ICONV_CONST if needed.
8491
8492 2004-02-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8493
8494         1.13.93 released.
8495
8496         * NEWS: Updated
8497         * tests/before: Move testing of the prerequisite archive formats
8498         to the separate function 'prereq'. Do not expect any arguments
8499         * tests/delete03.sh: Use prereq() instead of passing arguments
8500         to 'before'.
8501         * tests/incremen.sh: Likewise.
8502         * tests/listed01.sh: Likewise.
8503         * tests/multiv01.sh: Likewise.
8504
8505 2004-02-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8506
8507         Added UTF-8 support. Finished global extended header
8508         support.
8509
8510         * NEWS: Minor fix
8511         * configure.ac: Detect libiconv
8512         * src/utf8.c: New file. Conversions to and from utf-8.
8513         * src/Makefile.am: Added utf8.c
8514         * src/create.c (write_header_name) In pax format, use
8515         "path" keyword if the file name is not ASCII
8516         (start_header): Likewise for uname and gname.
8517         * src/list.c: Decode encountered global headers.
8518         * src/xheader.c: Use keywords from the global
8519         headers.
8520         Correctly handle UTF-8 conversions.
8521         (xheader_list_destroy): New function.
8522         (xheader_set_single_keyword,xheader_set_keyword_equal): Added
8523         missing gettext markers
8524         (decode_record): Rewritten using caller-provided handler and
8525         data closure.
8526         * tests/listed01.sh: Give credit to Andreas Schuldei.
8527
8528 2004-02-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8529
8530         * src/create.c (dump_file0): The conditional at line
8531         1296 prevented incremental backups on individual files
8532         from working, as reported by Andreas Schuldei
8533         <andreas@schuldei.org>.
8534
8535         This is due to the condition
8536
8537           (0 < top_level || !incremental_option)
8538
8539         Removing it makes incremental backups work for individual
8540         files as well as for directories. On the other hand, it does
8541         not affect other functionality, as shown by the reasoning below:
8542
8543         To begin with, the two parts of this condition are mutually
8544         superfluous, because
8545
8546           1) when top_level < 0, incremental_option == 1
8547           so the condition yields false
8548           2) when top_level >= 0, incremental_option == 0
8549           so the condition yields true.
8550
8551         In other words, it is completely equivalent to
8552
8553               (!incremental_option)
8554
8555         Now, let's consider the effect of its removal. There are two cases:
8556
8557         1) when incremental_option==1
8558         This means incremental backup in progress. In this case dump_file
8559         is invoked only for directories or for files marked with 'Y' by
8560         get_directory_contents. The latter are those that did not meet the
8561         condition in incremen.c:242, which is exactly the same condition
8562         as this at create.c:1296. So, for these files the check
8563         (!incremental_option) is useless, since the rest of the
8564         conditional will yield false anyway. On the other hand, if
8565         dump_file is invoked on a directory, the conditional will yield
8566         false due to !S_ISDIR assertion, so these will be processed as usual.
8567
8568         Thus, for this case the extra condition (!incremental_option) is
8569         irrelevant, and its removal won't alter the behavior of tar,
8570         *except* that it will enable incremental backups on individual
8571         files, which is the wanted effect.
8572
8573         2) when incremental_option==0
8574         In this case the condition yields true and its removal does not
8575         affect the functionality.
8576
8577         * THANKS: Updated
8578         * configure.ac: Raised patchlevel to 93
8579         * src/incremen.c: Minor stylistic fixes.
8580         * tests/listed01.sh: New test. Check listed incremental
8581         backups on individual files.
8582         * tests/Makefile.am: Added listed01.sh
8583
8584 2004-02-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8585
8586         * src/common.h (simple_finish_header,start_private_header): New
8587         declarations
8588         (xheader_ghdr_name): Changed declaration
8589         * src/create.c (start_private_header): Removed static qualifier.
8590         (write_extended): Removed superfluous last argument. Use
8591         xheader_write()
8592         (simple_finish_header): New function.
8593         (finish_header): Use simple_finish_header() to break recursive
8594         dependency between this function and write_extended().
8595         * src/tar.c (assert_format): Do not bail out if several
8596         --format arguments are given. This is a common case when
8597         TAR_OPTIONS are used.
8598         (decode_options): New option --show-defaults displays the
8599         compiled-in defaults.
8600         Use POSIX format if no --format option was given and
8601         --pax-option was specified.
8602         Do not allow to use --pax-option unless the archive format is
8603         set to POSIX (or reading subcommand is requested).
8604
8605         * src/update.c (update_archive): Write global extended header if
8606         constructed.
8607         * src/xheader.c (xheader_format_name): Bugfix.
8608         (xheader_xhdr_name): Changed the default extended header name
8609         to '%d/PaxHeaders.%p/%f', as POSIX requires.
8610         (xheader_ghdr_name): Removed unused argument.
8611         (xheader_write,xheader_write_global): New function.
8612         (xheader_decode): Modified to honor overrides whatever
8613         the current archive format is.
8614
8615         * src/delete.c (delete_archive_members): Call xheader_decode
8616         unconditionally.
8617         * src/list.c (decode_header): Likewise.
8618         * src/incremen.c (sort_obstack): Fixed typo in the comment
8619
8620         * doc/tar.texi: Document new default for extended
8621         header names.
8622
8623         * tests/before: Accept an optional list of allowed archive
8624         formats. Exit with the status 77 if the current archive
8625         format does not match any of them.
8626         * tests/delete03.sh: Require gnu, oldgnu or posix format
8627         * tests/incremen.sh: Require gnu or oldgnu format
8628         * tests/multiv01.sh: Likewise
8629
8630 2004-02-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8631
8632         * doc/tar.texi (Option Summary): Documented --pax-option
8633         * src/tar.c: Likewise.
8634         * NEWS: Likewise.
8635         * src/create.c (to_chars): Added a comment.
8636         * src/tar.h: Comment to GNU_FORMAT
8637
8638 2004-02-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8639
8640         * README: Updated
8641         * configure.ac: Added stpcpy
8642         * bootstrap: Likewise
8643         * lib/Makefile.am: Likewise
8644         * src/common.h (xheader_xhdr_name,xheader_ghdr_name): New
8645         functions
8646         * src/create.c (write_extended): Call xheader_xhdr_name
8647         instead of using hardcoded "././@PaxHeader" name.
8648         * src/tar.c: New option --pax-option (equivalent to -o option
8649         of pax).
8650         * src/xheader.c: Implement pax -o option. Fixed misleading
8651         heading comment (introduced 2003-09-02).
8652         * src/incremen.c: Minor fixes
8653         * m4/.cvsignore: Updated
8654
8655 2004-02-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8656
8657         * src/incremen.c: Removed accumulator stuff in favor of obstack.
8658         (get_directory_contents): Split into two functions
8659         * src/update.c: Minor changes
8660         * doc/tar.texi: Fixed typo
8661
8662 2004-02-15  Paul Eggert  <eggert@twinsun.com>
8663
8664         Fix Debian bug 230872, originally reported by Jeff King in
8665         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230872>.
8666
8667         * doc/tar.texi (posix compliance): Remove.  The whole section
8668         was a misunderstanding of what POSIXLY_CORRECT is supposed to
8669         mean.  The GNU Coding Standards says that POSIXLY_CORRECT
8670         is for disabling extensions that are incompatible with POSIX:
8671         it is not for disabling compatible extensions.  All references
8672         to this section removed.
8673         (posix): This format is created only if the posix format is
8674         specified; it is no longer created if gnu format is specified
8675         and POSIXLY_CORRECT is set.
8676         * src/tar.c (decode_options): Ignore POSIXLY_CORRECT.
8677         POSIX does not specify the behavior of tar, so we should
8678         not worry about POSIXLY_CORRECT here.
8679
8680 2004-01-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8681
8682         * Makefile.am: Removed m4
8683         * configure.ac: Require automake-1.8/autoconf-2.59. Removed
8684         m4/Makefile.
8685         * README-alpha: Updated
8686         * bootstrap: Updated TP URL, improved help output. Default
8687         to :ext:anoncvs and set CVS_RSH, unless already set.
8688         * m4/Makefile.am: Removed
8689
8690 2004-01-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8691
8692         * bootstrap: Bugfix by Marco Gerards <metgerards@student.han.nl>:
8693         Use $option instead of $1 so all options will be parsed.
8694
8695 2004-01-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8696
8697         Started rewriting buffer.c ...
8698
8699         * bootstrap: New option --no-po
8700         * src/buffer.c (new_volume,check_label_pattern): Changed return type.
8701         (time_to_start_writing): Changed data type
8702         (file_to_switch_to): Removed. Variable never assigned to.
8703         (open_archive) Moved option compatibility checks to tar.c
8704         Other minor changes.
8705         * src/common.h (maybe_backup_file): Changed return type
8706         * src/misc.c: Likewise.
8707         * src/create.c: Updated invocations of safer_name_suffix
8708         * src/extract.c: Likewise
8709         * src/delete.c: Updated assignment to write_archive_to_stdout
8710         * src/tar.c (decode_options): More option compatibility checks
8711         (moved from buffer.c)
8712         * src/update.c (time_to_start_writing): Changed data type.
8713         * tests/recurse.sh: New test case.
8714         * tests/mksparse.c: New file.
8715         * tests/Makefile.am: Added recurse.sh and mksparse.c
8716
8717 2004-01-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8718
8719         * src/sparse.c (sparse_diff_file): Bugfix. Thanks
8720         Martin Simmons for the patch.
8721         * src/create.c (dump_dir0): Bugfix. Thanks Piotr Czerwinski
8722         <pius@pld-linux.org> for the patch.
8723
8724 2003-12-26  Paul Eggert  <eggert@twinsun.com>
8725
8726         Synchronize with Gettext 0.13.1, Automake 1.8, Autoconf 2.59,
8727         and translation website.
8728
8729         * bootstrap: Don't bother skipping codeset.m4, glibc21.m4,
8730         intdiv0.m4, inttypes_h.m4, inttypes.m4, inttypes-pri.m4,
8731         isc-posix.m4, and lcmessage.m4 from gnulib.  This list of files is
8732         a bit obsolete anyway, now that gettext 0.13.1 is out.  Also, the
8733         files are replaced by autoreconf.  Also, there seems to be a bug
8734         in gettext/autoconf/automake if we try to omit these files after
8735         autoreconf has replaced them, even though the gettext manual says
8736         they're optional.  So give up and just include them for now, even
8737         though they make 'configure' longer and slower.
8738
8739         Change translation URL from
8740         <http://www.iro.umontreal.ca/contrib/po/maint/tar/> to
8741         <http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
8742         accommodate translator website revamp.
8743
8744         Fail if autoreconf fails.
8745
8746         * m4/.cvsignore: Add intmax.m4, longdouble.m4, printf-posix.m4,
8747         signed.m4, size_max.m4, wchar_t.m4, wint_t.m4, xsize.m4, to
8748         ignore files now supplied by gettext 0.13.1.
8749
8750 2003-12-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8751
8752         Synchronized with the backup repository on Mirddin
8753
8754 2003-12-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8755
8756         * configure.ac: Check for varios members of struct stat
8757         that may represent file modification times with a subsecond
8758         precision.
8759         Check for utimes (for future use)
8760         * src/buffer.c (short_read): Issue a warning on short reads.
8761         * src/common.h (sys_stat_nanoseconds): New function
8762         * src/create.c (dump_file0): Use sys_stat_nanoseconds().
8763         * src/list.c (read_and): Treat only two successive zero
8764         filled blocks as an EOF indicator. Issue a warning if
8765         a single one is encountered.
8766         * src/system.c (sys_stat_nanoseconds): New function
8767         * src/tar.h (tar_stat_info.atime_nsec,mtime_nsec,ctime_nsec): New
8768         members.
8769         * src/xheader.c (code_time,decode_time): Support for subsecond
8770         precision.
8771         (atime_coder,atime_decoder,ctime_coder,ctime_decoder)
8772         (mtime_coder,mtime_decoder): Update invocations of code_time and
8773         decode_time.
8774         (gid_decoder,size_decoder,uid_decoder,sparse_size_decoder)
8775         (sparse_numblocks_decoder,sparse_offset_decoder)
8776         (sparse_numbytes_decoder): Updated
8777
8778 2003-12-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8779
8780         * src/names.c (safer_name_suffix): Reverted change made
8781         2003-11-14. Reason: Discussion with Paul Eggert and
8782         Jean-Louis Martineau. See also ChangeLog entry from
8783         1999-08-14.
8784         * tests/delete03.sh: Likewise.
8785         * tests/extrac04.sh: Likewise.
8786         * tests/multiv01.sh: Likewise.
8787
8788 2003-12-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8789
8790         * src/incremen.c (write_directory_file): Use sys_truncate
8791         * src/list.c (print_header): Use archive_file_size member
8792         when printing real file size.
8793         * src/sparse.c (sparse_scan_file): Correctly handle files with
8794         a hole at the end.
8795         (sparse_dump_region,sparse_extract_region): Allow for zero size
8796         trailing blocks
8797
8798 2003-12-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8799
8800         * configure.ac: Raised version number to 1.13.92
8801         * src/list.c (decode_header): Discern between pax and ustar
8802         formats
8803         Initialize current_stat_info.archive_file_size.
8804
8805         NOTE: Modifications from this date on are temporarily
8806         stored on local CVS on mirddin. This repository will
8807         be synchronized with Savannah as soon as the latter
8808         becomes operational again.
8809
8810 2003-12-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8811
8812         * TODO: Updated
8813         * src/sparse.c: Initial implementation of GNU/pax sparse
8814         file format.
8815         * src/common.h (xheader_store): Changed prototype.
8816         * src/create.c: Update calls to xheader_store
8817         * src/extract.c (extract_archive): Check reported size vs.
8818         archive file size to determine if we have to do with a
8819         sparse file.
8820         * src/tar.c (usage): Cleaned up the sample argument to --newer
8821         option.
8822         (decode_options): Allow --sparse for POSIX_FORMAT archives.
8823         * src/xheader.c (struct xhdr_tab.coder; all coder function): Added
8824         extra argument
8825         Implemented GNU.sparse.* keywords.
8826
8827 2003-11-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8828
8829         * configure.ac: Check for setlocale. Thanks Bruno Haible for
8830         reporting.
8831
8832 2003-11-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8833
8834         * src/create.c (write_gnu_long_link): Use oldgnu
8835         magic with @LongLink blocks.
8836
8837 2003-11-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8838
8839         * src/tar.h: Support for star sparse format.
8840         * src/sparse.c: Likewise.
8841
8842 2003-11-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8843
8844         * src/sparse.c (sparse_diff_file): New function
8845         * src/common.h (sys_compare_uid,sys_compare_gid): New functions
8846         (sys_compare_uid_gid): Removed.
8847         (sys_compare_links,report_difference): Changed prototype
8848         (sparse_diff_file): New function
8849         * src/system.c (sys_compare_uid,sys_compare_gid): New functions
8850         (sys_compare_uid_gid): Removed.
8851         (sys_compare_links): Changed declaration
8852         * src/compare.c (diff_archive): Use sparse_diff_file.
8853
8854 2003-11-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8855
8856         Rewritten sparse file handling.
8857
8858         * src/sparse.c: New file. Provides a universal framework
8859         for various methods for sparse files handling.
8860         * src/Makefile.am: Added sparse.c
8861         * src/common.h (struct sp_array,sparsearray,sp_array_size)
8862         (init_sparsearray,fill_in_sparse_array): Removed
8863         (enum dump_status): New data type
8864         (pad_archive,close_diag,open_diag,read_diag_details)
8865         (readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
8866         functions.
8867         (sparse_file_p,sparse_dump_file,sparse_extract_file): New
8868         functions.
8869         (print_header): Changed prototype declaration.
8870         * src/tar.h (struct sp_array): Declaration from common.h
8871         (struct tar_stat_info): New members archive_file_size,
8872         sparse_map_avail,sparse_map.
8873         * src/create.c: Major rewrite.
8874         * src/extract.c: Use new sparse file interface.
8875         * src/compare.c (diff_sparse_files): Temporary placeholder.
8876
8877         * src/buffer.c: Minor changes
8878         * src/tar.c: Likewise.
8879         * src/list.c: Likewise.
8880         * src/misc.c (close_diag,open_diag,read_diag_details)
8881         (readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
8882         diagnostics functions.
8883         * src/incremen.c: Use new diagnostics functions.
8884         * src/names.c: Likewise.
8885
8886 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8887
8888         * configure.ac: Fixed check for setsockopt
8889
8890         * src/create.c: Do not zero-terminate name field if
8891         the name is exactly 100 characters long.
8892         (write_ustar_long_name): Fixed checking for unsplittable
8893         names.
8894
8895 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8896
8897         * src/create.c (start_header): Removed debugging hook
8898         (dump_file): Fixed handling of linkname field.
8899         * src/names.c (safer_name_suffix): If the input
8900         file name ends with a slash, output one should do so
8901         as well.
8902         * doc/tar.texi: Documented --format=ustar
8903
8904 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8905
8906         * src/tar.h (archive_format): USTAR_FORMAT: New type.
8907         * src/create.c: Added POSIX.1-1988 support.
8908         * src/names.c (safer_name_suffix): Skip leading ./
8909         * src/tar.c: New option --format=ustar forces
8910         POSIX.1-1988 archive format.
8911         * tests/delete03.sh: Updated.
8912         * tests/extrac04.sh: Updated.
8913         * tests/multiv01.sh: Updated.
8914
8915 2003-11-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8916
8917         * src/list.c (read_and): Initialize current_stat_info
8918         and extended_header at the start of the loop.
8919         * src/names.c (all_names_found): Check if the argument
8920         contains valid filename. Fixes coredump on `not_a_tar_file'
8921         * src/xheader.c (atime_decoder,gid_decoder,ctime_decoder)
8922         (mtime_decoder,size_decoder,uid_decoder): Use xstrtoumax.
8923         Fixes `pax-big-10g' bug.
8924
8925 2003-11-12  Paul Eggert  <eggert@twinsun.com>
8926
8927         Fix some C compatibility bugs reported by Joerg Schilling.
8928
8929         * src/common.h (stripped_prefix_len): Fix misspelling
8930         "stripped_path_len" in declaration.
8931         * src/rmt.c (main): Use "return FOO;" rather than
8932         "exit (FOO);"; we no longer have to worry about
8933         pre-ANSI hosts that mishandled returned values from "main".
8934         * src/tar.c (main): Likewise.  This avoids warnings on some
8935         compilers.
8936         * src/system.c: Include signal.h, for 'kill'.
8937         * src/system.h (DEV_BSIZE): Remove.
8938         (DEFAULT_ST_BLKSIZE): New macro.
8939         (ST_BLKSIZE): Use it, instead of DEV_BSIZE.
8940         * src/tar.c (enum): Remove comma just before }.
8941
8942 2003-11-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8943
8944         * src/list.c (decode_header): Initialize st_atime and
8945         st_ctime.
8946
8947 2003-11-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8948
8949         * configure.ac (tar_save_LIBS): Bugfix. Thanks Adrian
8950         Bunk <bunk@fs.tum.de> for reporting.
8951         * doc/tar.texi: Fixed spelling. Thanks Martin Buchholz
8952         <martin@xemacs.org> for spotting.
8953
8954 2003-11-04  Paul Eggert  <eggert@twinsun.com>
8955
8956         * src/xheader.c (xhdr_tab): Make it extern, not static, as C89 and
8957         C99 require this.
8958
8959 2003-10-26  Paul Eggert  <eggert@twinsun.com>
8960
8961         * src/system.c (sys_spawn_shell): Cast trailing null to (char *).
8962         Bug reported by Christian Weisgerber.
8963
8964 2003-10-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8965
8966         * AUTHORS: Updated
8967         * NEWS: Updated
8968         * src/tar.c (decode_options): Removed superfluous archive format
8969         check
8970         * doc/tar.texi: Documented new features.
8971
8972 2003-10-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8973
8974         * NEWS: Updated
8975         * THANKS: Added Wojciech Polak
8976         * configure.ac: Added checks for missing functions. Raised
8977         version number to indicate alpha release.
8978         * lib/Makefile.am: Added missing headers
8979         * lib/waitpid.c: Added missing includes.
8980         * src/extract.c: Likewise.
8981         * src/names.c: Removed spurious includes.
8982         * src/xheader.c: Likewise.
8983         * src/system.h [MSDOS]: Fixed spelling of EACCES. Added
8984         macro overriding broken mkdir prototypes.
8985
8986 2003-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
8987
8988         * configure.ac: Check for dev_t and ino_t.
8989         * m4/Makefile.am: Added missing files.
8990         * src/system.c: New file.
8991         * src/Makefile.am: Added system.c
8992         * src/common.h: Prototypes for functions from system.c
8993         * src/system.h (SET_BINARY_MODE, ERRNO_IS_EACCESS): New defines
8994         * src/buffer.c: Moved system dependencies to system.c
8995         * src/compare.c: Likewise.
8996         * src/create.c: Likewise.
8997         * src/delete.c: Likewise.
8998         * src/extract.c: Likewise.
8999         * src/rtapelib.c: Likewise.
9000
9001 2003-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9002
9003         Implemented --occurrence option.
9004
9005         * NEWS: Updated.
9006         * src/tar.c: New option --occurrence.
9007         * src/common.h (occurrence_option): New global
9008         (struct name): Changed `found' member to `uintmax_t
9009         found_count'.
9010         (names_done): Removed
9011         (all_names_found): Changed prototype.
9012         (ISFOUND,WASFOUND): New macros
9013         * src/delete.c (delete_archive_members): Honor --occurrence
9014         option.
9015         * src/list.c (read_and): Likewise.
9016         * src/names.c: Count number of occurrences of each name in the
9017         archive.
9018         (name_match): Honor --occurrence option.
9019         (names_done): Removed
9020         (all_names_found,names_notfound): Rewritten.
9021
9022 2003-10-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9023
9024         * src/tar.c: Removed extra precaution regarding
9025         subcommand_option == CAT_SUBCOMMAND
9026         * lib/Makefile.am: Updated
9027
9028 2003-10-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9029
9030         * src/common.h (names_done): New function.
9031         * src/names.c: Likewise.
9032         * src/list.c (read_and): Use all_names_found() as `while'
9033         condition.
9034         * src/tar.c: New option --first-copy
9035         * NEWS: Updated
9036
9037 2003-09-24  Paul Eggert  <eggert@twinsun.com>
9038
9039         * src/rmt.c (main): Don't translate Copyright string; international
9040         law says the word "Copyright" should be in English.
9041         * src/tar.c (decode_options): Likewise.
9042
9043 2003-09-22  Paul Eggert  <eggert@twinsun.com>
9044
9045         * doc/tar.texi (extracting untrusted archives): New section.
9046
9047         * src/common.h (stripped_path_len): Renamed from cut_path_elements.
9048         Return size_t, not pointer, so that we don't have to worry about
9049         violating the C standard by converting char const * to char *.
9050         All callers changed.
9051         * src/names.c (stripped_path_len): Likewise.  Strip file system
9052         prefix, too.  Count adjacent slashes as if they were one slash;
9053         that is the POSIX standard.
9054
9055 2003-09-17  Paul Eggert  <eggert@twinsun.com>
9056
9057         * README-alpha: Document maintainer tool assumptions a bit.  GNU
9058         'sed' is no longer required.  For GNU m4 1.4, suggest the patch in
9059         Debian bug 211447.  Fix minor misspellings/whitespace nits.
9060
9061         * configure.ac (AC_AIX, AC_MINIX): Remove; subsumed by
9062         gl_USE_SYSTEM_EXTENSIONS.
9063
9064         * lib/.cvsignore: Add exit.h, time_r.c, time_r.h.
9065         * m4/.cvsignore: Add restrict.m4, time_r.m4.
9066
9067 2003-09-17  Paul Eggert  <eggert@twinsun.com>
9068
9069         * bootstrap: Don't use "for option; do";
9070         Solaris 8 /bin/sh doesn't like that.
9071
9072 2003-09-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9073
9074         * README-alpha: Updated
9075         * bootstrap: Updated
9076
9077 2003-09-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9078
9079         * README-alpha: Updated
9080         * bootstrap: Updated
9081         * po/POTFILES.in: Added src/xheader.c
9082         * src/common.h (cut_path_elements): Added proto.
9083
9084 2003-09-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9085
9086         * src/buffer.c: Use ngettext where appropriate.
9087         * src/compare.c: Likewise.
9088         * src/create.c: Likewise.
9089         * src/misc.c: Likewise.
9090         * src/tar.c: Likewise.
9091         * src/update.c: Likewise.
9092
9093 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9094
9095         * .cvsignore: Added *.shar.gz
9096         * NEWS: Updated
9097         * TODO: Updated
9098         * src/common.h (strip_path_elements): New variable.
9099         * src/extract.c (extract_archive): Implemented --strip-path
9100         * src/names.c (cut_path_elements): New function.
9101         * src/tar.c: New option --strip-path=NUM.
9102         (decode_options) Assign boolean values to bool variables.
9103
9104 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9105
9106         * src/delete.c: Fixed deletion from the POSIX archives.
9107         * src/list.c (read_header): Minor change.
9108         * src/tar.c (main): Do not check for volume_label_option
9109         if subcommand_option is not CREATE_SUBCOMMAND.
9110         * src/xheader.c (xheader_decode): Store the header as
9111         well (for eventual delete).
9112
9113         * tests/incremen.sh: Explicitly request GNU format. This will
9114         disappear when GNU extended header keywords are working.
9115         * tests/multiv01.sh: Likewise
9116         * tests/volume.sh: Likewise
9117
9118 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9119
9120         * src/create.c: Support for "linkpath" extended keyword.
9121         * src/xheader.c (decode_record): Reversed the return
9122         condition.
9123
9124 2003-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9125
9126         * configure.ac: Allow to redefine the default output format.
9127         * src/tar.c: Use DEFAULT_ARCHIVE_FORMAT macro
9128         (archive_format_string): New function.
9129         (usage): Updated help output.
9130         * README: Updated.
9131         * NEWS: Updated.
9132         * TODO: Updated.
9133
9134 2003-09-02  Paul Eggert  <eggert@twinsun.com>
9135
9136         * src/common.h (destroy_stat, xheader_decode, xheader_store,
9137         xheader_read, xheader_finish, xheader_destroy): Add decls;
9138         C99 requires this.
9139
9140         * src/create.c (write_extended): Remove unused local 'bufsize'.
9141
9142         * src/delete.c (delete_archive_members): Handle case of
9143         HEADER_SUCCESS_EXTENDED followed by HEADER_FAILURE.
9144         * src/list.c (read_and): Abort if HEADER_SUCCESS_EXTENDED
9145         occurs, as it's not possible.
9146         * src/update.c (update_archive): Likewise.
9147
9148         Use "const" when possible in new code.
9149         * src/tar.c (struct fmttab.name): Now char const *.  All uses changed.
9150         (fmttab): Now const.  All uses changed.
9151         * src/xheader.c (struct xhdr_tab.keyword): Now pointer to const.
9152         (struct xhdr_tab.coder, struct xhdr_tab.decoder, locate_handler,
9153         decode_record, xheader_store, xheader_print, code_string, code_time,
9154         code_num, dummy_coder, dummy_decoder, atime_coder, atime_decoder,
9155         gid_coder, gid_decoder, gname_coder, gname_decoder, linkpath_coder,
9156         linkpath_decoder, ctime_coder, ctime_decoder, mtime_coder,
9157         mtime_decoder, path_coder, path_decoder, size_coder, size_decoder,
9158         uid_coder, uid_decoder, uname_coder, uname_decoder):
9159         Use pointers to const when possible.
9160         (xhdr_tab): Now const.
9161
9162         * src/tar.c (fmttab): Avoid GCC warning by not eliding initializers.
9163         (set_archive_format): Report an error if no format name matches,
9164         instead of returning an undefined value.
9165
9166         * src/xheader.c (struct xhdr_tab.decoder, dummy_decoder,
9167         atime_decoder, gid_decoder, gname_decoder, linkpath_decoder,
9168         ctime_decoder, mtime_decoder, path_decoder, size_decoder,
9169         uid_decoder, uname_decoder): Remove unused keyword arg.
9170         All uses changed.
9171
9172         * src/tar.c (set_archive_format): Now static.
9173         * src/xheader.c (xhdr_tab, format_uintmax): Now static.
9174
9175         * src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
9176         atime_decoder, gid_coder, gid_decoder, gname_coder, gname_decoder,
9177         linkpath_coder, linkpath_decoder, mtime_coder, mtime_decoder,
9178         ctime_coder, ctime_decoder, path_coder, path_decoder, size_coder,
9179         size_decoder, uid_coder, uid_decoder, uname_coder, uname_decoder):
9180         Remove forward decls; no longer needed.
9181         (xhdr_tab): Move to end, so that the forward decls aren't needed.
9182         Add a forward declaration.
9183
9184         Use 'bool' in new code, when appropriate.
9185         * src/xheader.c (decode_record): Return bool, not int.
9186         * src/common.h (read_header): Since it accepts bool, change
9187         all callers to use false and true rather than 0 and 1.
9188
9189         * src/xheader.c (decode_record): Fix misspelling in diagnostic
9190         "extended headed" -> "extended header".
9191
9192         GNU coding style fixes.
9193         * src/xheader.c (decode_record, xheader_decode):
9194         Do not use decls like "char *p, *q;".
9195
9196         Minor style fixes.
9197         (xheader_store): Avoid parentheses around object operand of sizeof.
9198
9199 2003-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9200
9201         * src/create.c (start_header): Store long file names
9202         in "path" keyword of an extended header if in POSIX
9203         mode.
9204         (finish_header): print header before calling write_extended().
9205         * src/list.c (list_archive): Always decode the header. This
9206         is necessary so the extended header is processed and the correct
9207         filename is printed no matter what the state of verbose_option.
9208         * src/xheader.c (xhdr_tab): Reserved GNU keywords (commented out
9209         for the time being).
9210
9211 2003-09-01  Paul Eggert  <eggert@twinsun.com>
9212
9213         Update from gnulib, and correct fnmatch to fnmatch-gnu.
9214         * bootstrap (gnulib_modules): Change fnmatch to fnmatch-gnu.
9215         Sort.
9216         * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Use this instead
9217         of AC_GNU_SOURCE.
9218         * lib/.cvsignore: Add alloca.h, stdbool.h.  Sort.  Append newline.
9219         * lib/Makefile.am (lib_OBJECTS): New macro, for convenience when
9220         copying rules from gnulib module descriptions.
9221         (BUILT_SOURCES, EXTRA_DIST, all-local, alloca.h):
9222         Update from gnulib modules alloca, fnmatch, getline, stdbool.
9223         * m4/.cvsignore: Add utimes-null.m4.  Sort.
9224
9225 2003-09-01  Sergey Poznyakoff
9226
9227         Added initial support for creating POSIX headers.
9228
9229         * src/common.h (MAXOCTAL11,MAXOCTAL7): New defines
9230         (string_to_chars): New functions
9231         (struct xheader): Changed structure
9232         (gid_to_gname,gname_to_gid,uid_to_uname,uname_to_uid): Changed
9233         prototypes.
9234         * src/create.c (string_to_chars): New function.
9235         (write_extended): New function
9236         (start_header): Create extended POSIX headers if necessary.
9237         (finish_header): Likewise.
9238         * src/list.c (print_header): Take user/group from
9239         current_stat_info.
9240         * src/names.c (gid_to_gname,gname_to_gid)
9241         (uid_to_uname,uname_to_uid): Changed prototypes.
9242         * src/tar.c: New option --format.
9243         * src/tar.h (OLDGNU_COMPATIBILITY): Removed
9244         (struct extra_header): Removed unused structure.
9245         (union block.extra_header): Removed unused member.
9246         * src/xheader.c: Implemented coder functions.
9247         * bootstrap: Added obstack.
9248         * lib/.cvsignore: Likewise.
9249         * configure.ac: Added 'gl_OBSTACK'
9250         * m4/Makefile.am: Added new files.
9251         * m4/.cvsignore: Likewise.
9252         * TODO: Minor formatting change
9253
9254 2003-08-31  Sergey Poznyakoff
9255
9256         Added initial support for POSIX extended and STAR headers
9257         (only for listing/extracting).
9258
9259         * src/xheader.c: New file.
9260         * src/Makefile.am: Added xheader.c
9261         * src/tar.h (struct star_header): New datatype
9262         (XHDTYPE,XGLTYPE): New defines
9263         (enum archive_format:STAR_FORMAT): New member
9264         (struct tar_stat_info): New datatype.
9265         (union block.star_header): New member.
9266         * src/common.h (orig_file_name,current_file_name)
9267         (current_trailing_slash,current_link_name): Removed variables.
9268         (current_stat_info): New variable
9269         (current_stat): Removed
9270         (extended_header): New variable
9271         (decode_header): Changed prototype.
9272         * src/list.c (decode_header): Added initial support for POSIX extended
9273         and STAR headers.
9274         (skip_member): Check oldgnu_header only if current_format is set
9275         to OLDGNU_FORMAT.
9276         * src/buffer.c: Use current_stat_info
9277         * src/compare.c: Likewise.
9278         * src/create.c: Likewise.
9279         * src/delete.c: Likewise.
9280         * src/incremen.c: Likewise.
9281         * src/mangle.c: Likewise.
9282         * src/update.c: Likewise.
9283         * src/extract.c: Likewise.
9284         (make_directories): Improved check for the existence of the directory
9285         * src/tar.c (destroy_stat): New function.
9286
9287 2003-08-29  Paul Eggert  <eggert@twinsun.com>
9288
9289         * NEWS, bootstrap: Drop en_GB locale; it was more trouble than it
9290         was worth (e.g., different users in en_GB disagree about -ize
9291         versus -ise).
9292         * po/en_GB.po: Remove.
9293
9294 2003-07-28  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9295
9296         * TODO: Updated
9297         * NEWS: Updated
9298         * src/tar.c: Removed support for the obsolete command line
9299         options.
9300         * doc/tar.texi: Removed references to the obsolete command
9301         line options.
9302
9303 2003-07-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9304
9305         * TODO: Updated
9306         * NEWS: Updated
9307         * doc/tar.texi: Updated
9308         * src/common.h (check_links_option): New variable
9309         (orig_file_name): New variable
9310         (check_links): New proto.
9311         * src/create.c (struct link.nlink): New member
9312         (link_table): Static for the module.
9313         (dump_file): Update `link' member when adding new links
9314         to the link_table.
9315         (check_links): New function.
9316         * src/list.c (print_header): Use orig_file_name.
9317         * src/tar.c: New option --check-links. Changed semantics of
9318         -o to comply to UNIX98 when extracting and to its previous
9319         semantics otherwise.
9320         (main): Call check_links if --check-links. was given.
9321
9322 2003-07-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9323
9324         * src/list.c (print_header): Revised
9325         * NEWS: Started the entry for 1.13.26
9326         * doc/Makefile.am (tar.dvi): Fixed TEXINPUTS value.
9327
9328 2003-07-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
9329
9330         * .cvsignore: Added to the repository.
9331         * doc/.cvsignore: Likewise.
9332         * lib/.cvsignore: Likewise.
9333         * m4/.cvsignore: Likewise.
9334         * po/.cvsignore: Likewise.
9335         * scripts/.cvsignore: Likewise.
9336         * src/.cvsignore: Likewise.
9337         * tests/.cvsignore: Likewise.
9338
9339         * lib/Makefile.am: Added exitfail.[hc]
9340         * src/misc.c (chdir_do): Fixed call to restore_cwd
9341         * src/buffer.c (flush_read): Fixed behavior on short
9342         reads right after opening the new archive (multiv01.sh test).
9343         (new_volume): Special handling for "-".
9344         * src/list.c (print_header): Print trailing slash if
9345         current_trailing_slash was set (extrac03.sh,extrac04.sh tests).
9346         * tests/multiv01.sh: Minor changes.
9347         * m4/Makefile.am: Added missing files.
9348
9349 2003-07-05  Paul Eggert  <eggert@twinsun.com>
9350
9351         Finish the checkin begin yesterday.
9352
9353         * NEWS: Document the user-visible changes installed in the last
9354         two days.
9355
9356         * TODO: New file (actually, resurrected; but with new contents).
9357
9358         * src/list.c (read_and): Give full type for procedure arg.
9359         (read_header): Strip trailing slashes, setting current_trailing_slash.
9360         (tartime): Avoid int overflow when printing year (!).
9361         (print_header): New arg specifying block ordinal.  All uses changed.
9362         Print link as 'h' type.  Give labels for long links and names.
9363
9364         * src/misc.c (contains_dot_dot): Moved to names.c
9365         (must_be_dot_or_slash): New function.
9366         (safer_rmdir): Use it.
9367         (remove_any_file): Now takes enum as option, not boolean.
9368         Check for (Linux) EISDIR as well as (POSIX) EPERM when attempting
9369         to unlink a directory.
9370         (deref_stat): Accept bool, not int.
9371
9372         * src/names.c (namelist_match): Allow partial matches only if
9373         recursive.
9374         (hash_string_hasher): Renamed from hash_avoided_name.
9375         (hash_string_compare): Renamed from compare_avoided_anames.
9376         (hash_string_insert, hash_string_lookup): New functions.
9377         (add_avoided_name, is_avoided_name): Use them.
9378         (safer_name_suffix): New function.
9379         (contains_dot_dot): Moved here from misc.c.  Now returns bool, not int.
9380
9381         * src/rmt.c: Don't include print-copyr.h.
9382         (prepare_input_buffer): New arg FD.
9383         Do not read more than INT_MAX bytes at once,
9384         since it breaks on some brain damaged Tru64 hosts.
9385         Divide size by two
9386         when retrying instead of subtracting 1024; for speed.
9387         (main): Use gettext to translate (C), not print_copyright.
9388
9389         * src/system.h: Include <alloca.h> and <stdbool.h> unconditionally,
9390         now that gnulib handles this.
9391         Include <stddef.h> and <limits.h> unconditionally, now that we assume
9392         C89 or better.
9393         Assume that offsetof is defined in stddef.h.
9394         Do not include <sys/param.h>.
9395         (realloc, lseek): Do not declare.
9396         (HAVE_DECL_VALLOC): Renamed from HAVE_VALLOC.
9397         (CHAR_BIT, CHAR_MAX, UCHAR_MAX, LONG_MAX): Remove
9398         declarations, since we now assume C89 or better.
9399         (PARAMS): Remove, as we now assume C89.  All uses changed.
9400         (bindtextdomain, textdomain): Include <gettext.h> to define.
9401         Include <unlocked-io.h>.
9402         (valloc): Define if not defined, and if valloc is not declared.
9403         (xstrdup): Remove decl.
9404
9405         * src/tar.c: Do not include <print-copyr.h>.
9406         Include <getdate.h>.
9407         (get_date): Remove decl.
9408         (ATIME_PRESERVE_OPTION, CHECKPOINT_OPTION, FORCE_LOCAL_OPTION,
9409         IGNORE_FAILED_READ_OPTION, INDEX_FILE_OPTION, NO_OVERWRITE_DIR_OPTION,
9410         NUMERIC_OWNER_OPTION, RECURSIVE_UNLINK_OPTION, REMOVE_FILES_OPTION,
9411         SHOW_OMITTED_DIRS_OPTION, TOTALS_OPTION): New constants.
9412         (long_options, decode_options): Use them.
9413         (OVERWRITE_DIR_OPTION): Remove.
9414         (long_options): New options --index-file, --no-overwrite-dir.
9415         Remove --overwrite-dir option.
9416         (usage): Use PACKAGE_BUGREPORT.
9417         (decode_options): Terminate new argv properly.
9418         Use PACKAGE_NAME, PACKAGE_VERSION.
9419         If verbose, report how we grokked any textual date option.
9420         (main): Add support for index-file.
9421
9422         * tests/Makefile.am: Convert to UTF-8.
9423         (AUTOMAKE_OPTIONS): Remove.
9424         (TESTS): Add delete04.sh, multiv01.sh, options.sh.
9425         (INCLUDES): Remove ../intl.
9426         (LDADD): Don't link libtar.a twice.
9427
9428         * tests/genfile.c: Convert to UTF-8.
9429         Don't include <print-copyr.h>.
9430         (DEFAULT_PATTERN): Renamed from DEFAULT.
9431         (ZEROS_PATTERN): Renamed from ZEROS.
9432         (main): Use gettext to translate (C), not print_copyright.
9433
9434 2003-07-04  Paul Eggert  <eggert@twinsun.com>
9435
9436         Revamp to meet current standards of autoconf, automake,
9437         gettext, and gnulib, and incorporate new translations.
9438
9439         * config/config.guess, config/config.sub, config/depcomp,
9440         config/install-sh, config/mdate-sh, config/missing,
9441         config/mkinstalldirs, config/texinfo.texi:
9442         Moved here from parent directory, or from doc.
9443         * config.hin: Renamed from config.h.in.
9444         * config/config.rpath: New file.
9445
9446         * intl: Remove this subdirectory.
9447
9448         * lib/fnmatch_.h: Renamed from lib/fnmatch.hin.
9449
9450         * lib/getstr.c, lib/getstr.h, lib/msleep.c, lib/print-copyr.c,
9451         lib/print-copyr.h, lib/readutmp.c, lib/rename.c, lib/stpcpy.c,
9452         lib/strstr.c, lib/strtoimax.c, lib/strtoll.c, lib/strtoull.c,
9453         lib/strtoumax.c, lib/unicodeio.c, lib/unicodeio.h,
9454         lib/xstrtoimax.c, m4/c-bs-a.m4, m4/ccstdc.m4, m4/check-decl.m4,
9455         m4/decl.m4, m4/jm-mktime.m4, m4/prereq.m4, m4/xstrtoimax.m4,
9456         stamp-h.in: Remove.
9457
9458         * lib/alloca_.h, lib/fnmatch_loop.c, lib/gettext.h, lib/pathmax.h,
9459         lib/safe-write.c, lib/safe-write.h, lib/stdbool_.h, lib/strcase.h,
9460         lib/stripslash.c, lib/unlocked-io.h, lib/xgetcwd.h, m4/alloca.m4,
9461         m4/backupfile.m4, m4/bison.m4, m4/chown.m4, m4/dirname.m4,
9462         m4/dos.m4, m4/exclude.m4, m4/fileblocks.m4, m4/ftruncate.m4,
9463         m4/getdate.m4, m4/getopt.m4, m4/hash.m4, m4/human.m4,
9464         m4/intdiv0.m4, m4/intmax_t.m4, m4/inttypes-pri.m4,
9465         m4/inttypes_h.m4, m4/isc-posix.m4, m4/lchown.m4, m4/lib-ld.m4,
9466         m4/lib-link.m4, m4/lib-prefix.m4, m4/memset.m4, m4/mktime.m4,
9467         m4/modechange.m4, m4/nls.m4, m4/onceonly.m4, m4/pathmax.m4,
9468         m4/po.m4, m4/quote.m4, m4/quotearg.m4, m4/rmdir.m4,
9469         m4/safe-read.m4, m4/safe-write.m4, m4/save-cwd.m4, m4/savedir.m4,
9470         m4/ssize_t.m4, m4/stdbool.m4, m4/stdint_h.m4, m4/strcase.m4,
9471         m4/strtoimax.m4, m4/strtol.m4, m4/strtoll.m4, m4/strtoul.m4,
9472         m4/strtoull.m4, m4/strtoumax.m4, m4/tm_gmtoff.m4, m4/uintmax_t.m4,
9473         m4/unlocked-io.m4, m4/xalloc.m4, m4/xgetcwd.m4, m4/xstrtol.m4,
9474         po/LINGUAS, po/Makevars, po/Rules-quot, po/boldquot.sed,
9475         po/en@boldquot.header, po/en@quot.header, po/en_GB.po,
9476         po/insert-header.sin, po/remove-potcdate.sin, po/stamp-po: New files.
9477
9478         * ABOUT-NLS, INSTALL, lib/addext.c, lib/alloca.c, lib/argmatch.c,
9479         lib/argmatch.h, lib/backupfile.c, lib/backupfile.h, lib/dirname.c,
9480         lib/dirname.h, lib/error.c, lib/exclude.c, lib/exclude.h,
9481         lib/fnmatch.h, lib/full-write.c, lib/full-write.h, lib/getdate.h,
9482         lib/getdate.y, lib/getline.c, lib/getline.h, lib/getopt.c,
9483         lib/getopt.h, lib/getopt1.c, lib/hash.c, lib/hash.h, lib/human.c,
9484         lib/human.h, lib/lchown.c, lib/malloc.c, lib/mktime.c,
9485         lib/modechange.c, lib/modechange.h, lib/quote.c, lib/quote.h,
9486         lib/quotearg.c, lib/quotearg.h, lib/realloc.c, lib/safe-read.c,
9487         lib/safe-read.h, lib/save-cwd.c, lib/save-cwd.h, lib/savedir.c,
9488         lib/savedir.h, lib/strcasecmp.c, lib/utime.c, lib/xalloc.h,
9489         lib/xgetcwd.c, lib/xmalloc.c, lib/xstrdup.c, lib/xstrtol.c,
9490         lib/xstrtol.h, lib/xstrtoumax.c, m4/codeset.m4, m4/d-ino.m4,
9491         m4/error.m4, m4/fnmatch.m4, m4/getcwd.m4, m4/getline.m4, m4/gettext.m4,
9492         m4/glibc21.m4, m4/iconv.m4, m4/inttypes.m4, m4/lcmessage.m4,
9493         m4/longlong.m4, m4/malloc.m4, m4/mbrtowc.m4, m4/mbstate_t.m4,
9494         m4/progtest.m4, m4/realloc.m4, m4/strerror_r.m4, m4/ulonglong.m4,
9495         m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4, m4/xstrtoumax.m4,
9496         po/Makefile.in.in:
9497         Upgrade to latest version from external source.  The file "bootstrap"
9498         now grabs these automatically, so we needn't keep track of them
9499         in this change long any longer.
9500
9501         * Makefile.am (AUTOMAKE_OPTIONS): Remove.  Now done by configure.ac.
9502         (SUBDIRS): Remove intl.
9503         * PORTS: Update for star, Macintosh.
9504         * README, README-alpha: Suggest Autoconf 2.57, Automake 1.7.5,
9505         Bison 1.875, gettext 0.12.1.
9506         * THANKS: Add Bernhard Rosenkraenzer, Solar Designer.
9507         * configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Convert to modern form.
9508         (AC_CONFIG_AUX_DIR): New.
9509         (AC_CONFIG_HEADERS): Rename config.h.in to config.hin, to be more
9510         like coreutils.
9511         (AC_PREREQ): Bump from 2.52 to 2.57.
9512         (AC_GNU_SOURCE): New.
9513         (AC_PROG_GCC_TRADITIONAL, AM_C_PROTOTYPES, AC_C_CONST): Remove;
9514         we no longer support K&R C.
9515         (YACC): Remove.
9516         (AC_CHECK_HEADERS): Remove limits.h, poll.h, stdbool.h, stropts.h,
9517         sys/ioccom.h, sys/param.h, sys/time.h, sys/timeb.h, wchar.h, wctype.h.
9518         (AC_MBSTATE_T): Remove.
9519         (HAVE_UTIME_H, HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
9520         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
9521         HAVE_DECL_STRTOULL, HAVE_MKNOD): Remove our special code.
9522         (AM_STDBOOL_H): Add.
9523         (AC_HEADER_TIME, AC_STRUCT_TIMEZONE,
9524         jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Remove.
9525         (AC_CHECK_TYPE): Remove ssize_t.
9526         (gt_TYPE_SSIZE_T): Add.
9527         (jm_AC_PREREQ_XSTRTOUMAX, jm_PREREQ_ADDEXT, jm_PREREQ_ERROR,
9528         jm_PREREQ_HUMAN, jm_PREREQ_QUOTEARG, jm_PREREQ_XGETCWD,
9529         AC_FUNC_ALLOCA, AC_FUNC_CLOSEDIR_VOID, AC_FUNC_STRERROR_R,
9530         AC_FUNC_FNMATCH, AC_FUNC_VPRINTF, AM_FUNC_GETLINE, jm_FUNC_MALLOC,
9531         jm_FUNC_MKTIME, jm_FUNC_REALLOC):
9532         Remove.  Switch to gnulib macros like gl_BACKUPFILE instead.
9533         (tar_LDADD): Rename to LIB_CLOCK_GETTIME.  All uses changed.
9534         (rmt_LDADD): Rename to LIB_SETSOCKOPT.  All uses changed.
9535         (AC_CHECK_FUNCS): Remove fchdir, ftime, getcwd, isascii, nap,
9536         napms, poll, select, strstr, usleep.
9537         (AC_REPLACE_FUNCS): Remove ftruncate, lchown, memset, rename,
9538         rmdir, strcasecmp, strncasecmp, strtol, strtoul.
9539         (AM_GNU_GETTEXT): Use external and need-ngettext options.
9540         (AM_GNU_GETTEXT_VERSION): New.
9541         (AC_OUTPUT): Remove intl/Makefile.
9542
9543         * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9544         ($(srcdir)/tar.info, tar.dvi): Remove obsolete warnings.
9545         * doc/fdl.texi: Update to current GNU version.
9546         * doc/gettext.texi: Update to current coreutils version,
9547         plus a copyright notice.
9548         * doc/tar.texi: Switch to new method for doing copyright notices.
9549         Use @acronym instead of @sc where appropriate.
9550         Remove empty examples.  Give a few more examples.
9551
9552         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9553         (EXTRA_DIST, libtar_a_SOURCES): Switch to gnulib, so that they
9554         are built up in pieces with +=.
9555         (noinst_HEADERS, INCLUDES): Remove.
9556         (BUILT_SOURCES, MAINTAINERCLEANFILES, MOSTLYCLEANFILES): New.
9557         (libtar_a_LIBADD): Use $ rather than @.
9558         (all-local, alloca.h, fnmatch.h, stdbool.h): New rules, from gnulib.
9559
9560         * m4/Makefile.am (EXTRA_DIST): Add alloca.m4, backupfile.m4,
9561         bison.m4, chown.m4, dirname.m4, dos.m4, exclude.m4, fileblocks.m4,
9562         ftruncate.m4, getdate.m4, getopt.m4, hash.m4, human.m4,
9563         intdiv0.m4, intmax_t.m4, inttypes_h.m4, inttypes-pri.m4,
9564         isc-posix.m4, lcown.m4, lib-ld.m4, lib-link.m4, lib-prefix.m4,
9565         memset.m4, mktime.m4, modechange.m4, nls.m4, onceonly.m4,
9566         pathmax.m4, po.m4, quotearg.m4, quote.m4, rmdir.m4, safe-read.m4,
9567         safe-write.m4, save-cwd.m4, savedir.m4, ssize_t.m4, stdbool.m4,
9568         stdint_h.m4, strcase.m4, strtoimax.m4, strtoll.m4, strtol.m4,
9569         strtoull.m4, strtoul.m4, strtoumax.m4, tm_gmtoff.m4, uintmax_t.m4,
9570         unlocked-io.m4, xalloc.m4, xgetcwd.m4, xstrtol.m4.
9571         Remove c-bs-a.m4, ccstdc.m4, check-decl.m4, decl.m4, jm-mktime.m4,
9572         prereq.m4, xstrtoimax.m4.
9573
9574         * po/POTFILES.in: Remove tests/genfile.c; it doesn't need to
9575         be translated, since it's not a user-visible tool.
9576
9577         * scripts/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9578
9579         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9580         (INCLUDES): Remove ../intl.  Put top-srcdir before ., for
9581         consistency with coreutils.
9582         (LDADD): Link LIBINTL after libtar.a, since
9583         it's now external and should stand by itself.
9584
9585         * src/buffer.c (print_total_written): Adjust to new human.h
9586         interface.
9587         (child_open_for_compress): Do not increase size to BLOCKSIZE.
9588         (open_archive): Open index file name.
9589         Strip trailing slashes from file names.
9590         (flush_write): Set size to 0 if not saving names.
9591         (flush_write, flush_read): Use safer_name_suffix rather than
9592         inline code.
9593
9594         * src/common.h: Include <quote.h>.
9595         (absolute_names_option, atime_preserve_option, backup_option,
9596         block_number_option, checkpoint_option, dereference_option,
9597         force_local_option, ignore_failed_read_option, ignore_zeros_option,
9598         incremental_option, interactive_option, multi_volume_option,
9599         numeric_owner_option, one_file_system_option, recursive_unlink_option,
9600         read_full_records_option, remove_files_option, same_order_option,
9601         show_omitted_dirs_option, sparse_option, starting_file_option,
9602         to_stdout_option, totals_option, touch_option, verify_option,
9603         dev_null_output, now_verifying, we_are_root): Now bool, not int.
9604         (current_trailing_slash, index_file_name, recent_long_name_blocks,
9605         recent_long_link_blocks): New vars.
9606         (NO_OVERWRITE_DIR_OLD_FILES): New constant.
9607         (OVERWRITE_OLD_DIRS): Remove.
9608         (enum remove_option): New enum.
9609         (remove_any_file): Use it as option arg, not int.
9610         (is_avoided_name, contains_dot_dot): Return bool, not int.
9611         (safer_name_suffix): New decl.
9612
9613         * src/compare.c (now_verifying): Now bool, not int.
9614         (fill_in_sparse_array): Move to extract.c.  Now returns bool;
9615         all callers changed to test for failure.
9616         (diff_sparse_files): Take size from current_stat, not from param.
9617         (diff_archive): Do not count trailing slashes in archives.
9618         (verify_volume): Test for header failure after loop, not before.
9619
9620         * src/create.c (relativize): Remove; replaced by safer_name_suffix.
9621         All callers changed.
9622         (start_header): Clear devmajor and devminor fields, too.
9623         (finish_header): New arg block_ordinal.
9624         (init_sparsearray): Now extern.  Set sp_array_size to
9625         SPARSES_IN_OLDGNU_HEADER if it is zero.
9626         (dump_file): Keep link table as a hash.
9627         Do not count "file changed as we read it" as a failure.
9628
9629         * src/delete.c (recent_long_name_blocks, recent_long_link_blocks):
9630         Move extern decl to common.h.
9631
9632         * src/extract.c (we_are_root): Now bool, not int.
9633         (check_time): Warn about implausibly old time stamps.
9634         (set_stat): Use utimbuf, not stat_info.
9635         (prepare_to_extract): New arg DIRECTORY.
9636         (fill_in_sparse_array): Moved here from compare.c.
9637         (extract_sparse_file): Now returns off_t, giving size left.
9638         Truncate file at end.
9639         (extract_archive): Use safer_name_suffix rather than rolling our own.
9640         Use fill_in_sparse_array rather than rolling our own.
9641         Strip trailing slashes more effectively.
9642         Check for unsafe names.
9643
9644         * src/incremen.c (struct directory): nfs and found are now of type
9645         bool, not int.
9646         (gnu_restore): Now takes directory name as argument, not offset
9647         of directory name in a global.  All uses changed.
9648         (CURRENT_FILE_NAME): Remove.
9649
9650         New tests.
9651         * tests/delete04.sh, tests/multiv01.sh, tests/options.sh: New
9652         files.
9653
9654 2002-09-30  Paul Eggert  <eggert@twinsun.com>
9655
9656         * src/rmt.c (prepare_input_buffer): Renamed form
9657         prepare_record_buffer.  All uses changed.  Do not assume that
9658         size_t is the same width as int.
9659
9660 2002-03-29  Paul Eggert  <eggert@twinsun.com>
9661
9662         * src/incremen.c (get_directory_contents):
9663         If ignore_failed_read_option, only warn about
9664         get_directory_contents failures.  Fix suggested by
9665         Mark Costlow.
9666
9667 2002-01-31  Mark W. Eichin  <eichin@thok.org>
9668
9669         * src/buffer.c (child_open_for_compress): Don't try to read
9670         past the end of the buffer.
9671
9672 2001-10-11  Jim Meyering  <meyering@lucent.com>
9673
9674         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
9675         and quote_n (1, ... to avoid clobbering a buffer.
9676
9677 2001-09-26  Paul Eggert  <eggert@twinsun.com>
9678
9679         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.25.
9680
9681         * src/buffer.c (flush_read): Don't diagnose partial blocks before
9682         end of file; just ignore them silently.
9683
9684         * src/list.c (read_header): Don't keep around extended name
9685         and link info indefinitely; keep it only for the next file.
9686         This fixes a bug introduced in 1.13.24, and removes the need
9687         for some static variables.  Set recent_long_name and
9688         recent_long_link to zero if there were no long links; this
9689         avoids a violation of ANSI C rules for pointers in delete.c.
9690         * THANKS: Add Christian Laubscher.
9691
9692 2001-09-26  Jim Meyering  <meyering@lucent.com>
9693
9694         * doc/tar.texi (Remote Tape Server): is know -> is known
9695
9696 2001-09-25  Paul Eggert  <eggert@twinsun.com>
9697
9698         * lib/unicodeio.c (EILSEQ): Include <iconv.h> first, since
9699         <iconv.h> may define EILSEQ (e.g. libiconv).  Define a
9700         replacement EILSEQ to be ENOENT, not EINVAL, since callers may
9701         want to distinguish EINVAL and EILSEQ.
9702
9703 2001-09-24  Christophe Kalt  <Christophe.Kalt@kbcfp.com>
9704
9705         * src/extract.c (maybe_recoverable):
9706         Treat OVERWRITE_OLD_DIRS like DEFAULT_OLD_FILES.
9707
9708 2001-09-22  Paul Eggert  <eggert@twinsun.com>
9709
9710         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.24.
9711
9712         * ABOUT-NLS, intl/*: Update to gettext-0.10.40, replacing LGPL
9713         with GPL.
9714
9715         * INSTALL, mkinstalldirs: Update to autoconf 2.52 version.
9716         * PORTS: Add copyright notice, 'star' reference.
9717         * README-alpha: Add copyright notice, autoconf 2.52 patch.
9718         * THANKS: Add Christophe Kalt.
9719         * config.sub: Upgrade to 2001-09-14 version.
9720
9721         * configure.ac (ALL_LINGUAS): Add ko.
9722         * po/ko.po: Resurrected file.
9723
9724         * doc/convtexi.pl: Add coding advice for Emacs.
9725
9726         * doc/getdate.texi: Add copyright notice.
9727
9728         * doc/mdate-sh: Upgrade to automake 1.5 version.
9729
9730         * doc/tar.texi (extracting files): Mention --to-stdout.
9731         (Option Summary, Dealing with Old Files): New option --overwrite-dir.
9732         (Overwrite Old Files): Likewise.
9733
9734         * lib/Makefile.am (noinst_HEADERS):
9735         Remove copysym.h.  Add print-copyr.h, unicodeio.h.
9736         (libtar_a_SOURCES): Remove copysym.c, Add print-copyr.c, unicodeio.c.
9737
9738         * lib/copysym.c, lib/copysym.h: Remove.
9739         * lib/print-copyr.c, lib/print-copyr.h, lib/unicodeio.c,
9740         lib/unicodeio.h: New files.
9741
9742         * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
9743         lib/mktime.c, lib/strtoll.c: Switch from LGPL to GPL.
9744
9745         * lib/quotearg.c (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
9746         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
9747
9748         * m4/Makefile.am (EXTRA_DIST): Remove isc-posix.m4.
9749         * m4/isc-posix.m4: Remove.
9750
9751         * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit.
9752
9753         * po/POTFILES.in: Add copyright notice.
9754
9755         * src/Makefile.am (LDADD): Like libtar.a before @INTLLIBS@ as
9756         well as after.
9757         * tests/Makefile.am (LDADD): Likewise.
9758
9759         * src/buffer.c (write_archive_buffer, close_archive):
9760         If an archive is a socket, treat it like a FIFO.
9761         (records_read, records_written): New vars.
9762         (write_archive_to_stdout): Now bool, not int.
9763         (open_archive, flush_write, flush_read): Keep records_read and
9764         records_written up to date.
9765
9766         * src/common.h (enum old_files): New value OVERWRITE_OLD_DIRS.
9767         (write_archive_to_stdout): Now bool, not int.
9768         (enum read_header): New value HEADER_SUCCESS_EXTENDED.
9769         (read_header): Now takes bool arg.  Existing callers modified
9770         to pass 0, unless otherwise specified.
9771
9772         * src/delete.c (records_read): Remove; now a global.
9773         (acting_as_filter): Now bool, not int.
9774         (recent_long_name, recent_long_link, recent_long_name_blocks,
9775         recent_long_link_blocks, records_read, records_written): New decls.
9776         (records_skipped): New var.
9777         (move_archive): Don't divide by zero if arg is 0.
9778         Use the above vars to compute how far to move.
9779         (write_recent_blocks): New function.
9780         (delete_archive_member): Pass 1 to read_header, so that it doesn't
9781         read more than 1 block.  Handle resulting HEADER_SUCCESS_EXTENDED code.
9782         Keep track of how many records have been skipped.
9783         Let the buffer code count records.
9784         When copying a header, copy any extended headers that came before it.
9785
9786         * src/extract.c (extract_archive): When marking a directory to be
9787         updated after symlinks, stat all directories after it in the
9788         delayed-set-stat list too, since they will be checked after
9789         symlinks.  Add support for --overwrite-dir.
9790
9791         * src/list.c (recent_long_name, recent_long_link,
9792         recent_long_name_blocks, recent_long_link_blocks): New vars.
9793         (read_and): Pass 0 to read_header.
9794         (read_header): New arg RAW_EXTENDED_HEADERS.  Store away extended
9795         headers into new vars.  Null-terminate incoming symbolic links.
9796
9797         * src/rmt.c: Include print-copyr.h, not copysym.h.
9798         (main): Use print_copyright, not copyright_symbol.
9799         * src/tar.c (decode_options): Likewise.
9800         (OVERWRITE_DIR_OPTION): New constant.
9801         (long_options, usage, decode_options): Add --overwrite-dir.
9802
9803         * src/tar.h: Put copyright notice into documentation.
9804
9805         * tests/Makefile.am (TESTS): Add delete03.sh.
9806         * tests/delete03.sh: New file.
9807
9808         * tests/genfile.c: Include print-copyr.h, not copysym.h.
9809         (main): Use print_copyright, not copyright_symbol.
9810         Include <argmatch.h>.
9811         (pattern_strings): Remove.
9812         (pattern_args, pattern_types): New constants.
9813         (main): Use XARGMATCH, not argmatch.
9814
9815 2001-09-20  Jim Meyering  <meyering@lucent.com>
9816
9817         * lib/xstrtol.c (strtoimax): Guard declaration with
9818         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
9819         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
9820         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
9821         (strtoumax): Likewise, for completeness (it wasn't necessary).
9822         * m4/xstrtoimax.m4 (jm_AC_PREREQ_XSTRTOIMAX):
9823         Check for declaration of strtoimax.
9824         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
9825         Check for declaration of strtoumax.
9826
9827 2001-09-16  Paul Eggert  <eggert@twinsun.com>
9828
9829         * fnmatch.m4 (jm_FUNC_FNMATCH): Fix typo in previous patch: yes -> no.
9830
9831 2001-09-14  Paul Eggert  <eggert@twinsun.com>
9832
9833         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.23.
9834
9835         * README-alpha: Describe automake patch.
9836
9837         * configure.ac (LIBOBJS):
9838         Remove automake 1.4 workaround, as we're using 1.5 now.
9839         (USE_INCLUDED_LIBINTL): New AC_DEFINE.
9840
9841         * lib/copysym.c: Include stddef.h, for size_t.
9842         Include langinfo.h if needed.
9843         Use locale_charset only if USE_INCLUDED_LIBINTL;
9844         if not, use nl_langinfo (CODESET) if available.
9845
9846 2001-09-13  Paul Eggert  <eggert@twinsun.com>
9847
9848         * config.guess, config.sub: Sync with canonical versions.
9849
9850         * configure.ac (jm_PREREQ_XGETCWD): Add.
9851
9852         * lib/Makefile.am (noinst_HEADERS): Add copysym.h.
9853         (libtar_a_SOURCES): Add copysym.c.
9854         * copysym.c, copysym.h: New files.
9855
9856         * lib/error.c: Sync with fileutils version.
9857
9858         * m4/Makefile.am (EXTRA_DIST): Add getcwd.m4; remove uintmax_t.m4.
9859         * m4/getcwd.m4: New file.
9860         * m4/uintmax_t.m4: Remove.
9861
9862         * m4/gettext.m4 (AM_WITH_NLS):
9863         Fix bug with calculating version of Bison 1.29.
9864         Reported by Karl Berry.
9865
9866         * src/Makefile.am (datadir): Remove.
9867
9868         * src/rmt.c: Include copysym.h.
9869         (main): Use copyright_symbol to translate copyright notice,
9870         instead of gettext.
9871         * src/tar.c: Likewise.
9872         * tests/genfile.c: Likewise.
9873
9874         * src/system.h (MB_LEN_MAX): New symbol.
9875
9876 2001-09-11  Paul Eggert  <eggert@twinsun.com>
9877
9878         * src/extract.c (struct delayed_set_stat): New member
9879         'after_symlinks'.
9880         (delay_set_stat): Initialize it to 0.
9881         (set_mode): New arg current_stat_info.  Use it (if nonnull) to avoid
9882         taking an extra stat ourselves.  All callers changed.
9883         (set_stat): Likewise.
9884         (apply_nonancestor_delayed_set_stat): New arg 'after_symlinks'.
9885         If false, stop when encountering a struct whose 'after_symlinks'
9886         member is true.  Otherwise, go through all structures but check
9887         them more carefully.  All callers changed.
9888         (extract_archive): When extracting a deferred symlink, if its parent
9889         directory's status needs fixing, then mark the directory as needing
9890         to be fixed after symlinks.
9891         (extract_finish): Fix status of ordinary directories, then apply
9892         delayed symlinks, then fix the status of directories that are
9893         ancestors of delayed symlinks.
9894
9895         * src/rtapelib.c (rexec):
9896         Remove declaration; it ran afoul of prototypes on Crays.
9897         Reported by Wendy Palm of Cray.
9898
9899 2001-09-06  Paul Eggert  <eggert@twinsun.com>
9900
9901         * lib/strtoimax.c (HAVE_LONG_LONG):
9902         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
9903         (strtoimax): Use sizeof (long), not
9904         sizeof strtol (ptr, endptr, base),
9905         to work around bug in IBM C compiler.
9906
9907 2001-09-04  Paul Eggert  <eggert@twinsun.com>
9908
9909         * lib/xgetcwd.c: Include "xalloc.h".
9910         (xgetcwd): Do not return NULL when memory is exhausted; instead,
9911         report an error and exit.
9912
9913         * m4/prereq.m4 (jm_PREREQ_XREADLINK): New macro.
9914         (jm_PREREQ): Use it.
9915
9916 2001-09-03  Paul Eggert  <eggert@twinsun.com>
9917
9918         * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_XGETCWD.
9919         (jm_PREREQ_XGETCWD): New macro.
9920
9921         * lib/exclude.c (fnmatch_no_wildcards):
9922         Fix typo that caused us to do case-folding
9923         search even when that was not desired.  This occurred only in the
9924         no-wildcard case.
9925
9926         * lib/xgetcwd.c: Include pathmax.h if not HAVE_GETCWD.
9927         Do not include xalloc.h.
9928         (INITIAL_BUFFER_SIZE): New symbol.
9929         Do not use xmalloc / xrealloc, since the caller is responsible for
9930         handling errors.  Preserve errno around `free' during failure.
9931         Do not overrun buffer when using getwd.
9932
9933         * lib/xgetcwd.c (xgetcwd):
9934         Use HAVE_GETCWD_NULL, not defined __GLIBC__ && __GLIBC__ >= 2,
9935         to decide whether to use getcwd (NULL, 0).
9936
9937 2001-09-02  Paul Eggert  <eggert@twinsun.com>
9938
9939         * lib/xgetcwd.c: Fix typo in local var; from Jim Meyering.
9940
9941 2001-09-01  Jim Meyering  <meyering@lucent.com>
9942
9943         * exclude.c: Use `""', not `<>' to #include non-system header files.
9944         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
9945         and strncasecmp as r-values.  Unixware didn't have declarations.
9946
9947 2001-08-31  Jim Meyering  <meyering@lucent.com>
9948
9949         * lib/xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
9950         Use an initial, malloc'd, buffer of length 128 rather than
9951         a statically allocated one of length 1024.
9952
9953 2001-08-30  Paul Eggert  <eggert@twinsun.com>
9954
9955         * lib/utime.c: Include full-write.h.
9956         * lib/xstrtol.c (strtoimax): New decl.
9957
9958 2001-08-29  Paul Eggert  <eggert@twinsun.com>
9959
9960         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.22.
9961
9962         * src/create.c (dump_file): Relativize link names before dumping.
9963         This fixes a bug reported by Jose Pedro Oliveira.
9964
9965         * src/create.c (dump_file): Use offsetof when computing sizes for
9966         struct hack; this avoids wasted space in some cases.
9967         * src/incremen.c (note_directory, find_directory): Likewise.
9968         * src/names.c (name_gather, addname): Likewise.
9969
9970         * src/extract.c (extract_archive): Use strcpy, not memcpy,
9971         for consistency with other code that does similar things.
9972         * src/names.c (name_gather): Likewise.
9973
9974         * src/names.c (read_name_from_file, name_next, name_gather,
9975         add_hierarchy_to_namelist): Avoid quadratic behavior when
9976         reallocating buffers.  Check for buffer size overflow.
9977         (addname): Avoid unnecessary clearing of memory.
9978
9979 2001-08-29  "Jan D."  <Jan.Djarv@mbox200.swipnet.se>
9980
9981         * src/extract.c (delay_set_stat): Fix off-by-one error in file
9982         name size allocation that caused core dumps.
9983
9984 2001-08-28  Paul Eggert  <eggert@twinsun.com>
9985
9986         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.21.
9987
9988         * configure.ac (GNU_SOURCE): Define to 1, not /**/.
9989         (major_t, minor_t, ssize_t): Use new-style AC_CHECK_TYPE.
9990         (daddr_t): Remove; no longer used.
9991         (jm_PREREQ_HUMAN): Add.
9992
9993         * acconfig.h: Remove; no longer needed.
9994
9995         * config.guess, config.sub:
9996         New files, from automake 1.5.  Gettext 0.10.39 needs them.
9997         * depcomp, missing, mkinstalldirs: Upgrade to automake 1.5.
9998
9999         * Makefile.am (AUTOMAKE_OPTIONS): Add dist-bzip2.
10000         (SUBDIRS): Put intl before lib, as gettext requires.
10001
10002         * ABOUT-NLS: Upgrade to gettext 0.10.39.
10003         * intl: Upgrade entire directory to gettext 0.10.39.
10004         * m4/codeset.m4, m4/glibc21.m4, m4/iconv.m4:
10005         New files, from gettext 0.10.39.
10006         * m4/gettext.m4, m4/isc-posix.m4, m4/lcmessage.m4, m4/progtest.m4,
10007         Upgrade to gettext 0.10.39,
10008         * po/Makefile.in.in: Likewise, except fix a typo in its copying
10009         permissions.
10010         * po/cat-id-tbl.c, po/stamp-cat-id:
10011         Remove; no longer used by gettext 0.10.39.
10012         * po/ChangeLog: New file.
10013
10014         * doc/Makefile.am (EXTRA_DIST): Add freemanuals.texi.
10015         $(srcdir)/tar.texi: Likewise.
10016         * doc/freemanuals.texi: New file.
10017         * doc/tar.texi (Free Software Needs Free Documentation): New appendix.
10018         `fileds' -> `fields'
10019         * doc/texinfo.tex: Upgrade to version 2001-07-25.07.
10020
10021         * lib/Makefile.am (EXTRA_DIST): Add strtoll.c, strtoimax.c.
10022         (noinst_HEADERS): Add quote.h.
10023         (libtar_a_SOURCES): Add quote.c, xstrtoimax.c.
10024
10025         * lib/exclude.c: Fix typo in '#include <stdint.h>' directive.
10026
10027         * lib/full-write.c, lib/savedir.c: Comment fix.
10028
10029         * lib/pathmax.h: Remove.
10030
10031         * lib/quote.c, lib/quote.h: New files.
10032
10033         * lib/xgetcwd.c: Don't include pathmax.h.
10034         Include stdlib.h and unistd.h if available.
10035         Include xalloc.h.
10036         (xmalloc, xstrdup, free): Remove decls.
10037         (xgetcwd): Don't assume sizes fit in unsigned.
10038         Check for overflow when computing sizes.
10039         Simplify reallocation code.
10040
10041         * lib/xmalloc.c: Quote failure tests.
10042
10043         * lib/strtoumax.c, lib/xstrtoimax.c: New files.
10044
10045         * lib/strtoimax.c: Renamed from strtouxmax.c.  Make it more
10046         similar to strtol.c.
10047         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.
10048         (verify): New macro.
10049         (strtoumax, uintmax_t, strtoull, strtol): Remove.
10050         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
10051         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
10052         changed to signed values.  Check sizes at compile-time, not
10053         run-time.  Prefer strtol to strtoll if both work.
10054         (main): Remove.
10055
10056         * lib/xstrtol.h (xstrtoimax): New decl.
10057
10058         * m4/Makefile.am (EXTRA_DIST):
10059         Add codeset.m4, glibc21.m4, iconv.m4, inttypes.m4,
10060         longlong.m4, xstrtoimax.m4.
10061
10062         * m4/inttypes.m4 (jm_AC_HEADER_INTTYPES_H):
10063         Remove; now done by autoconf.
10064         (jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Replace with
10065         Use AC_CHECK_TYPE instead of merely looking for the header.
10066
10067         * m4/uintmax_t.m4: Use shorter comment.
10068
10069         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
10070         Quote first arg of AC_DEFUN.
10071         Require jm_AC_TYPE_INTMAX_T and jm_AC_TYPE_LONG_LONG since they
10072         is needed to parse the include file.
10073         Simplify logic behind the args to AC_REPLACE.
10074
10075         * src/Makefile.am (OMIT_DEPENDENCIES): Remove.
10076
10077         * src/ansi2knr.1, src/ansi2knr.c: Remove; wasn't being used.
10078
10079         * src/rmt.c (main):
10080         Use "Copyright %d" to simplify the translator's job in the future.
10081         Advise translator about circle-C.
10082         * src/tar.c: (decode_options): Likewise.
10083         * tests/genfile.c (main): Likewise.
10084
10085 2001-08-28  Jim Meyering  <meyering@lucent.com>
10086
10087         * lib/argmatch.c: Include "quote.h".
10088         (argmatch_invalid): Quote the context.
10089
10090         * lib/dirname.c (dir_name): Fix typo on PC platforms.
10091
10092         * lib/backupfile.c, lib/basename.c, lib/dirname.c, lib/strtoul.c:
10093         Use single-quote for local .h files.
10094
10095         * lib/error.h (__attribute__): Don't depend on __STRICT_ANSI__.
10096
10097         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Upgrade to recent
10098         glibc versions.
10099
10100         * lib/getdate.y (get_date): Initialize tm_isdst to -1 before
10101         invoking mktime the last time.
10102
10103         * lib/pathmax.h: Use #if rather than #ifdef for HAVE_UNISTD_H.
10104
10105         * lib/rename.c: Major rewrite by Volker Borchert to use system
10106         rename function, but to work around problems with trailing
10107         slashes.
10108
10109         * lib/strtoll.c: New file, from glibc.
10110         * lib/strtoul.c: Update from glibc.
10111
10112         * lib/strtouxmax.c: Renamed from lib/strtoumax.c.
10113         Add support for signed numbers, too.
10114         (strtoul, strtoull): Do not declare if STRTOUXMAX_UNSIGNED
10115         is not defined.
10116         (strtol, strtoll): Declare as needed, if STRTOUXMAX_UNSIGNED is
10117         not defined.
10118         (strtoumax, uintmax_t, strtoull, strtoul): New macros.
10119         (main): Use generic names in debugging output.
10120         * lib/strtoimax.c: Plus add the following changes of my own:
10121         (main): Use accurate names in debugging output.
10122
10123         * lib/xgetcwd.c (xgetcwd): Use getcwd if glibc 2 or later.
10124         Don't use PATH_MAX.
10125
10126         * m4/c-bs-a.m4, m4/check-decl.m4, m4/d-ino.m4, m4/error.m4,
10127         m4/getline.m4, m4/jm-mktime.m4, m4/malloc.m4, m4/mbrtowc.m4,
10128         m4/mbstate_t.m4, m4/realloc.m4, m4/uintmax_t.m4, m4/utimbuf.m4,
10129         m4/utime.m4, m4/utimes.m4:
10130         Quote the first argument in each use of AC_DEFUN.
10131
10132         * m4/getline.m4: Don't use string.h.
10133
10134         * m4/inttypes.m4, m4/longlong.m4, m4/xstrtoimax.m4: New files.
10135
10136         * m4/mbrtowc.m4 (jm_FUNC_MBRTOWC): @%:@ -> #.
10137
10138 2001-08-27  Paul Eggert  <eggert@twinsun.com>
10139
10140         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.20.
10141
10142         The biggest change is the new --exclude semantics and options.
10143         The basic idea was suggested by Gerhard Poul; thanks!
10144
10145         * NEWS: Describe new --exclude semantics and options, and bug fixes.
10146         * README: ignfail.sh fails on some NFS hosts.
10147         * NEWS, README, lib/xstrtol.h: Add copyright notice.
10148
10149         * Makefile.am (ACLOCAL_AMFLAGS): Add -I m4.
10150         (M4DIR, ACINCLUDE_INPUTS, $(srcdir)/acinclude.m4):
10151         Remove; the automake bug has been fixed.
10152         * acinclude.m4: Remove.
10153
10154         * configure.ac: Renamed from configure.in.
10155         (AC_PREREQ): Bump from 2.13 to 2.52.
10156         (ALL_LINGUAS): Add id, tr.  Remove ko, as po/ko.po (dated
10157         1997-05-30) has an encoding error.
10158         (jm_AC_HEADER_INTTYPES_H): Remove; now done by autoconf.
10159         (AC_FUNC_FNMATCH): Use AC_CONFIG_LINKS, not AC_LINK_FILES.
10160
10161         * doc/fdl.texi: Update to current GNU version.
10162
10163         * doc/tar.texi: Put leading '*' in direntry.
10164         Accommodate new gfdl sectioning.
10165         New option --recursion (the default) that is the inverse of
10166         --no-recursion.
10167
10168         New options --anchored, --ignore-case, --wildcards,
10169         --wildcards-match-slash, and their negations (e.g., --no-anchored).
10170         Along with --recursion and --no-recursion, these control how exclude
10171         patterns are interpreted.  The default interpretation of exclude
10172         patterns is now --no-anchored --no-ignore-case --recursion
10173         --wildcards --wildcards-match-slash.
10174
10175         * lib/Makefile.am (OMIT_DEPENDENCIES): Remove.
10176
10177         * lib/exclude.c (bool): Declare, perhaps by including stdbool.h.
10178         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
10179         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
10180         Include if available.
10181         (<xalloc.h>): Include
10182         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
10183         (verify): New macro.  Use it to verify that EXCLUDE macros do not
10184         collide with FNM macros.
10185         (struct patopts): New struct.
10186         (struct exclude): Use it, as exclude patterns now come with options.
10187         (new_exclude): Support above changes.
10188         (new_exclude, add_exclude_file):
10189         Initial size must now be a power of two to simplify overflow checking.
10190         (free_exclude, fnmatch_no_wildcards): New function.
10191         (excluded_filename): No longer requires options arg, as the options
10192         are determined by add_exclude.  Now returns bool, not int.
10193         (excluded_filename, add_exclude):
10194         Add support for the fancy new exclusion options.
10195         (add_exclude, add_exclude_file): Now takes int options arg.
10196         Check for arithmetic overflow when computing sizes.
10197         (add_exclude_file): xrealloc might modify errno, so don't
10198         realloc until after errno might be used.
10199
10200         * lib/exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
10201         New macros.
10202         (free_exclude): New decl.
10203         (add_exclude, add_exclude_file): Now takes int options arg.
10204         (excluded_filename): No longer requires options arg, as the options
10205         are determined by add_exclude.  Now returns bool, not int.
10206
10207         * lib/prepargs.c: Include <string.h>; required for C99 since
10208         we use strlen.
10209
10210         * lib/quotearg.c:
10211         BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared.
10212
10213         * lib/xstrtol.h (_DECLARE_XSTRTOL): Improve quality of
10214         diagnostic for LONGINT_INVALID_SUFFIX_CHAR.
10215
10216         * m4/Makefile.am (EXTRA_DIST): Add check-decl.m4, mbrtowc.m4.
10217         Remove inttypes_h.m4, largefile.m4, mktime.m4.
10218
10219         * m4/inttypes_h.m4, m4/largefile.m4, m4/mktime.m4: Remove;
10220         subsumed by Autoconf 2.50.
10221
10222         * m4/error.m4: Upgrade to serial 2.
10223
10224         * m4/fnmatch.m4 (jm_FUNC_FNMATCH): Upgrade to serial 4, but
10225         remove test for GNU C library.  It's not correct, as some
10226         older glibcs are buggy.
10227
10228         * m4/getline.m4, m4/malloc.m4: Upgrade to serial 4.
10229
10230         * m4/prereq.m4: Upgrade to serial 20, but then:
10231         (jm_PREREQ): Add jm_PREREQ_EXCLUDE.
10232         (jm_PREREQ_EXCLUDE): New macro.
10233         (jm_PREREQ_HUMAN): Remove jm_AC_HEADER_INTTYPES_H, as it is subsumed
10234         by autoconf 2.5x.
10235
10236         * m4/realloc.m4: Upgrade to serial 4.
10237
10238         * m4/strerror_r.m4: Revert to serial 1002.
10239
10240         * m4/uintmax_t.m4: Upgrade to autoconf 2.5x.
10241
10242         * m4/utimes.m4: Upgrade to latest version (still "serial 3").
10243
10244         * m4/xstrtoumax.m4: Upgrade to serial 3, but then:
10245         (jm_AC_PREREQ_XSTRTOUMAX): Remove jm_AC_HEADER_INTTYPES_H, as
10246         it is now subsumed by autoconf.  Add inttypes.h.
10247
10248         * po/cs.po, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
10249         po/it.po, po/pl.po, po/sl.po, po/sv.po: Sync with translation project.
10250
10251         * src/buffer.c (new_volume): Stop if the script exits with an error.
10252
10253         * src/common.h (excluded_with_slash, excluded_without_slash):
10254         Remove, replacing by:
10255         (excluded): New decl.
10256         (link_error): New decl.
10257         (excluded_name): Now returns bool.
10258
10259         * src/extract.c:
10260         (struct delayed_symlinks, extract_archive, apply_delayed_symlinks):
10261         Support hard links to symbolic links.
10262
10263         (struct delayed_symlink): Remove 'names' member, replacing it with
10264         'sources' and 'target' member.  All uses changed.
10265
10266         (struct string_list): New type.
10267
10268         (delayed_set_stat, extract_archive): Use offsetof when computing sizes
10269         for struct hack; this avoids wasted space in some cases.
10270
10271         (extract_archive): Fix test for absolute pathnames and/or "..".
10272         Use link_error to report errors for links.
10273         Remove redundant trailing '/' at "really_dir", for all uses, not
10274         just before invoking mkdir.
10275         If overwriting old files, do not worry so much about existing
10276         directories.
10277         Fix mode computation in the case where the directory exists.
10278
10279         (apply_delayed_symlinks): If we can't make a hard link to a symbolic
10280         link, make a copy of the symbolic link.
10281
10282         * src/incremen.c (get_directory_contents):
10283         If ignore_failed_read_option, only warn about
10284         stat failures.
10285
10286         * src/list.c (from_header): Do not issue a diagnostic if TYPE is zero.
10287         However, check for error even for '-' or '+' case.
10288
10289         (print_header): Try parsing uids and gids as unsigned integers first,
10290         and as a uid_t or gid_t only if that fails.  This adds support for
10291         listing positive uids and gids that are greater than UID_MAX and
10292         GID_MAX.
10293
10294         * src/misc.c (link_error): New function.
10295
10296         * src/names.c (collect_and_sort_names):
10297         If ignore_failed_read_option, only warn about
10298         stat errors.
10299
10300         (excluded_name): Now returns bool.  Simplify, as the fancy
10301         features are now all in excluded_filename.
10302
10303         * src/rtapelib.c (base_name): Remove decl, as system.h now
10304         declares it.
10305
10306         * src/system.h: Include stddef.h if available.
10307         (offsetof): Declare if stddef.h doesn't.
10308
10309         Include <dirname.h>.
10310         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now defined by dirname.h.
10311
10312         * src/tar.c (ANCHORED_OPTION, IGNORE_CASE_OPTION,
10313         NO_ANCHORED_OPTION, NO_IGNORE_CASE_OPTION, NO_WILDCARDS_OPTION,
10314         NO_WILDCARDS_MATCH_SLASH_OPTION, WILDCARDS_OPTION,
10315         WILDCARDS_MATCH_SLASH_OPTION):
10316         New enum values.
10317
10318         (long_options, usage, decode_options): Add support for --anchored,
10319         --ignore-case, --no-anchored, --no-ignore-case, --no-wildcards,
10320         --no-wildcards-match-slash, --recursion, --wildcards,
10321         --wildcards-match-slash.
10322
10323         (decode_options): Implement the new way of interpreting exclude
10324         patterns.
10325
10326         (usage): --newer-mtime takes a DATE operand.  DATE may be a file name.
10327
10328         (OPTION_STRING, decode_options): Add -I, -y.  Currently these options
10329         just print error messages suggesting alternatives.
10330
10331         (add_filtered_exclude): Remove.
10332
10333         * tests/Makefile.am (TESTS): Alphabetize, except put version.sh first.
10334
10335         * tests/extrac04.sh (out): Remove
10336         directory/subdirectory/file1, as the new semantics for
10337         --exclude exclude it.
10338
10339         * tests/genfile.c (main): Don't use non-ASCII char in msgid.
10340
10341 2001-08-12  Paul Eggert  <eggert@twinsun.com>
10342
10343         * lib/addext.c (<errno.h>): Include.
10344         (errno): Declare if not defined.
10345         (addext): Work correctly on the Hurd, where pathconf returns -1 and
10346         leaves errno alone, because there is no limit.  Also, work even if
10347         size_t is narrower than long.
10348
10349 2001-07-08  Paul Eggert  <eggert@twinsun.com>
10350
10351         * lib/alloca.c (alloca): Arg is of type size_t, not unsigned.
10352
10353 2001-05-10  Paul Eggert  <eggert@twinsun.com>
10354
10355         * lib/addext.c (ISSLASH, base_name): Remove decls; now in dirname.h.
10356         Include <backupfile.h> and <dirname.h> after size_t is defined.
10357         (addext): Use base_len to trim redundant trailing slashes instead of
10358         doing it ourselves.
10359
10360         * lib/backupfile.c (ISSLASH, base_name):
10361         Remove decls; now in dirname.h.
10362         Include <argmatch.h>, <backupfile.h>, <dirname.h> after size_t
10363         is defined.
10364         (find_backup_file_name): Rename locals to avoid new functions.
10365         Use base_len instead of rolling it ourselves.
10366         Work even if dirlen is 0.
10367         Use a dir of '.' if given the empty string.
10368
10369         * lib/basename.c:
10370         Do not include <stdio.h>, <assert.h>; no longer needed.
10371         (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Remove; now in dirname.h.
10372         Include <string.h>, <dirname.h>.
10373         (base_name): Allow file names ending in slashes, other than names
10374         that are all slashes.  In this case, return the basename followed
10375         by the slashes.
10376
10377         * lib/dirname.c: Include <string.h> instead of <stdlib.h>.
10378         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now in dirname.h.
10379         (dir_len): Renamed from dirlen.
10380         All callers changed.
10381
10382         * lib/dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
10383         New macros.
10384         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
10385
10386 2001-02-16  Paul Eggert  <eggert@twinsun.com>
10387
10388         * lib/quotearg.c (mbrtowc, mbrtowc, mbsinit):
10389         Do not declare or define if HAVE_MBRTOWC,
10390         since the test for HAVE_MBRTOWC now requires proper declarations.
10391
10392         * lib/alloca.c (malloc): Undef before defining.
10393
10394 2001-02-13  Paul Eggert  <eggert@twinsun.com>
10395
10396         * src/compare.c (read_and_process): Use off_t for size.
10397         From Maciej W. Rozycki.
10398
10399 2001-01-26  Paul Eggert  <eggert@twinsun.com>
10400
10401         * lib/quotearg.c: Include stddef.h.  From Jim Meyering.
10402
10403 2001-01-12  Paul Eggert  <eggert@twinsun.com>
10404
10405         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.19.
10406
10407         * lib/savedir.h (savedir): Remove size arg.
10408
10409         * doc/tar.texi: Add @setchapternewpage odd.
10410         Remove -I as an alias for -T, for now.
10411         Add @dircategory.
10412         Update copyright.  Remove "Published by".
10413         Dates beginning with / or . are taken to be file names.
10414
10415         * src/tar.c (<time.h>): Do not include;
10416         (time): Do not declare.
10417         (usage): Remove -I as an alias for -T.
10418         (OPTION_STRING): Remove -I.
10419         (decode_options): Dates that look like an absolute path name,
10420         or that start with '.', are presumed to be file names whose
10421         dates are taken.
10422         Remove 'I' as an alias for 'T'.
10423         Update copyright.
10424
10425         * src/extract.c (<time.h>): Do not include; system.h now does this.
10426         (make_directories): Skip filesystem prefixes.
10427         Don't assume '/' is the only separator.
10428         (extract_sparse_file): Use new full_write semantics.
10429         On write error, return instead of invoking skip_file.
10430         Do not free sparsearray; caller does this now.
10431         (apply_nonancestor_delayed_set_stat): Do not assume '/' is the only
10432         separator.
10433         (extract_archive): Don't assume file name lengths fit in int.
10434         Report what got stripped from member name; it might be more than '/'.
10435         Use new full_write semantics.
10436         Do not pass redundant trailing "/" to mkdir, as POSIX does not allow
10437         mkdir to ignore it.
10438         Do not report mkdir error if old_files_option == KEEP_OLD_FILES.
10439
10440         * src/buffer.c (<time.h>): Do not include; system.h now does this.
10441         (time): Remove decl; likewise.
10442         (child_open_for_uncompress): Use new full_write semantics.
10443         (flush_write): Use ISSLASH instead of testing for '/'.
10444         (flush_read): Likewise.
10445
10446         * src/rmt.h (_remdev): Look for / anywhere in Path.
10447
10448         * src/misc.c (contains_dot_dot): Skip filesystem prefix.
10449         Don't assume '/' is the only separator.
10450         (safer_rmdir): Don't assume '/' is the only separator.
10451
10452         * src/compare.c (diff_archive): Don't assume '/' is the only separator.
10453
10454         * lib/dirname.h (dirlen): New decl.
10455
10456         * src/incremen.c (get_directory_contents):
10457         Remove path_size arg; all callers changed.
10458         Don't assume '/' is the only directory separator.
10459         (gnu_restore): Work even if file name length doesn't fit in int.
10460
10461         * lib/addext.c (ISSLASH): New macro.
10462         (addext): Trim any redundant trailing slashes.
10463
10464         * src/names.c (name_next):
10465         Don't assume '/' is the only directory separator.
10466         (namelist_match): Likewise.
10467         (add_hierarchy_to_namelist): Remove dirsize arg.
10468         Do not assume '/' is the only directory separator.
10469         (new_name): Likewise.
10470
10471         * lib/Makefile.am (noinst_HEADERS): Add dirname.h, full-write.h.
10472         (libtar_a_SOURCES): Add dirname.c.
10473
10474         * src/create.c (relativize):
10475         New function, with much of old start_header's guts.
10476         Handle filesystem prefixes.
10477         (start_header): Use this new function.
10478         (init_sparsearray): Don't bother to zero out the new array;
10479         it's not needed.
10480         (deal_with_sparse): Fix array allocation bug.
10481         (create_archive): Don't assume '/' is the only separator.
10482         (dump_file): Likewise.
10483         Don't worry about leading / in symlink targets.
10484
10485         * lib/savedir.c (savedir):
10486         Remove size arg; it wasn't portable.  All callers changed.
10487
10488         * lib/utime.c (utime_null): Adjust to new full_write convention.
10489
10490         * configure.in (YACC): Avoid portability problem with Ultrix sh.
10491
10492         * lib/backupfile.c: Include <dirname.h>.
10493         (ISSLASH): New macro.
10494         (find_backup_file_name): Use dirlen to calculate directory lengths.
10495         (max_backup_version): Strip redundant trailing slashes.
10496
10497         * src/common.h: Include <full-write.h>.
10498         (get_directory_contents): No longer has size arg.
10499         (gnu_restore): Arg is size_t, not int.
10500
10501         * src/system.h: Include <time.h>.
10502         (time): Declare if not defined.
10503
10504         * lib/full-write.c: Include full-write.h, not safe-read.h.
10505         full_write returns size_t, with short writes meaning failure.
10506         All callers changed.
10507
10508         * src/rtapelib.c: Include full-write.h.
10509
10510         * src/rmt.c: Include full-write.h.
10511         (main): Update copyright.
10512
10513         * doc/getdate.texi: Mention that only English is supported.
10514         Show how to use "date" so that the output is acceptable to getdate.
10515         Mention Z as an abbreviation for UTC.
10516
10517         * lib/full-write.h: New file.
10518
10519         * src/list.c: system.h now does time.h stuff.
10520
10521         * lib/dirname.c:
10522         Use HAVE_STDLIB_H, not STDC_HEADERS, to decide whether to include
10523         stdlib.h.
10524         Do not include string.h, strings.h, or assert.h; no longer needed.
10525         (strrchr, memrchr, malloc): Remove decls; no longer needed.
10526         Include <xalloc.h>.
10527         (base_name): New decl.
10528         (BACKSLASH_IS_PATH_SEPARATOR): Remove.
10529         (dir_name_r): Remove.
10530         (dirlen): New function.
10531         (dir_name): Use dirlen instead of dir_name_r.
10532         (<string.h>, <strings.h>): Include only if test program.
10533         (main): Use "return 0", not "exit (0)".
10534
10535 2000-12-08  Paul Eggert  <eggert@twinsun.com>
10536
10537         * lib/dirname.h: New file.
10538
10539 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
10540
10541         * lib/fnmatch.c: Do not comment out all the code if we are using
10542         the GNU C library, because in some cases we are replacing buggy
10543         code in the GNU C library itself.
10544
10545 2000-10-30  Paul Eggert  <eggert@twinsun.com>
10546
10547         * lib/fnmatch.c (FOLD): Do not assume that characters are unsigned.
10548
10549 2000-10-29  Paul Eggert  <eggert@twinsun.com>
10550
10551         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.18.
10552
10553         * src/tar.c: Include <fnmatch.h>, for FNM_LEADING_DIR.
10554
10555 2000-10-28  Paul Eggert  <eggert@twinsun.com>
10556
10557         * doc/tar.texi: --no-recursion now applies to extraction, too.
10558         * src/create.c (dump_file): no_recurse_option -> ! recursion_option
10559         * src/names.c (namelist_match, excluded_name):
10560         Do not match subfiles of a directory
10561         if --no-recursion is specified.
10562         * src/tar.c (NO_RECURSE_OPTION): Remove.
10563         (long_options): Have getopt set the --no-recursion flag.
10564         (decode_options): Initialize recursion_option to FNM_LEADING_DIR.
10565         Remove case for NO_RECURSE_OPTION.
10566         * src/common.h (recursion_option):
10567         Renamed from no_recurse_option, with sense
10568         negated, and with FNM_LEADING_DIR being the nonzero value.
10569
10570         * names.c (namelist_match): New function.
10571         (name_match, name_scan): Use it to eliminate duplicate code.
10572         (names_notfound): Remove special case for Amiga.
10573
10574 2000-10-27  Paul Eggert  <eggert@twinsun.com>
10575
10576         * src/misc.c (read_error_details, read_warn_details,
10577         read_fatal_details): Don't assume size_t is unsigned long.
10578
10579         * src/buffer.c (flush_read): If read_full_records_option, try to
10580         fill the input buffer, as --delete -f - needs this.
10581
10582 2000-10-24  Paul Eggert  <eggert@twinsun.com>
10583
10584         * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Port to autoconf 2.13.
10585
10586         * src/buffer.c (check_label_pattern):
10587         Make sure header name is a string before
10588         passing it to fnmatch.
10589         (init_volume_number): Check for global_volno overflow.
10590         (new_volume): Check for global_volno overflow.
10591
10592         * src/tar.c (decode_options):
10593         Check that volume label is not too long to overflow
10594         name in tar header block.
10595
10596         * Makefile.am (EXTRA_DIST): Remove rebox.el.
10597
10598         * configure.in (HAVE_DECL_STRERROR_R): Remove our handwritten code.
10599         (AC_FUNC_STRERROR_R): Use this instead.
10600
10601 2000-10-23  Paul Eggert  <eggert@twinsun.com>
10602
10603         * src/extract.c: Include <time.h>, since we invoke "time".
10604
10605         * lib/prepargs.c (prepend_default_options):
10606         Don't use NULL, for portability.
10607
10608         * m4/fnmatch.m4: Add "working" to message.
10609
10610         * src/names.c: (_GNU_SOURCE): Remove; autoconf now does this.
10611         Include <hash.h>.
10612         (getpwuid, getgrgid): Declare only if system headers don't.
10613         (gid_to_gname): Don't invoke setgrent.
10614         (namelist): Now static, not global.
10615         (nametail): New var.  All uses of namelast changed to use
10616         nametail, with one extra level of indirection.
10617         (name_gather): Use memcpy instead of strncpy + assignment of NUL.
10618         (name_match): Set nametail too, when setting namelist to null.
10619         (add_hierarchy_to_namelist): Change type of dir arg from char * to
10620         struct name *, so that we don't have to look up the name again
10621         here.  Get change_dir from dir rather than as a separate arg.  Add
10622         dirsize arg, and pass it along to get_directory_contents.  Remove
10623         unnecessary check of directory type.
10624         (new_name): Do not append a slash if PATH already ends in one.
10625         (avoided_names, struct avoided_name): Remove.
10626         (avoided_name_table): New var, replacing avoided_names.
10627         (hash_avoided_name, compare_avoided_names): New function.
10628         (add_avoided_name, is_avoided_name): Use hash table rather than
10629         linked list.
10630
10631         * src/buffer.c (_GNU_SOURCE): Remove; autoconf now does this.
10632         (child_open_for_compress, child_open_for_uncompress,
10633         close_archive): Propagate any failure of the compression process
10634         back to "tar".
10635         (open_archive, flush_write, flush_read, close_archive): Do not
10636         allocate an array of size PATH_MAX, as PATH_MAX might be (size_t)
10637         -1.  Instead, allocate an array with the size that's needed.
10638         (open_archive): Don't bother checking S_ISCHR of /dev/null.
10639         (backspace_output): Don't try to backspace past start of archive.
10640         (close_archive): Remove special case for DELETE_SUBCOMMAND.
10641
10642         * acconfig.h (_GNU_SOURCE, DEFAULT_ARCHIVE, DEFAULT_BLOCKING,
10643         DENSITY_LETTER, DEVICE_PREFIX, EMUL_OPEN3, HAVE_GETGRGID,
10644         HAVE_GETPWUID, HAVE_MKNOD, HAVE_RTAPELIB, HAVE_ST_FSTYPE_STRING,
10645         HAVE_UNION_WAIT, HAVE_UTIME_H, HAVE_VALLOC, MTIO_CHECK_FIELD, PACKAGE,
10646         PROTOTYPES, REMOTE_SHELL, STD_INC_PATH, VERSION, WITH_CATALOGS,
10647         WITH_DMALLOC, WITH_REGEX):
10648         Remove; now generated automatically.
10649
10650         * configure.in (_GNU_SOURCE): Define to empty, not 1, for
10651         compatibility for glibc fragments.
10652         (_GNU_SOURCE, HAVE_UTIME_H, MTIO_CHECK_FIELD,
10653         HAVE_ST_FSTYPE_STRING, HAVE_MKNOD, REMOTE_SHELL, DENSITY_LETTER,
10654         DEVICE_PREFIX, DEFAULT_ARCHIVE, DEFAULT_BLOCKING): Add comment so
10655         that we needn't put an entry into acconfig.h.
10656         (ALL_LINGUAS): Add da.
10657         (AC_C_BACKSLASH_A): Remove; jm_PREREQ_QUOTEARG now does this.
10658         (AC_CHECK_HEADERS): Add stdbool.h (for hash.h users), wctype.h
10659         (for strtol.c).
10660         (AC_MBSTATE_T): Add.
10661         (RMT): Append $(EXEEXT).
10662         (HAVE_GETGRGID, HAVE_GETPWUID, pe_AC_TYPE_SIGNED_CHAR): Remove.
10663         (HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
10664         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
10665         HAVE_DECL_STRTOULL, HAVE_DECL_STRERROR_R): New macros.
10666         (jm_PREREQ_ADDEXT, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG): Add.
10667         (AC_REPLACE_FUNCS): Remove execlp; no longer needed.
10668         (AC_CHECK_FUNCS): Add clock_gettime; AC_SEARCH_LIBS wasn't enough.
10669         Remove mbrtowc; jm_PREREQ_QUOTEARG now does this.
10670         (EMUL_OPEN3): Remove; no longer needed.
10671         (DENSITY_LETTER, DEVICE_PREFIX): Simplify m4 quoting.
10672
10673         * m4/fnmatch.m4 (AC_FUNC_FNMATCH): Detect d*/*1 vs d/s/1 bug.
10674
10675         * src/common.h: Do not include basename.h.
10676         * src/rtapelib.c (base_name): Do not include basename.h;
10677         declare base_name instead.
10678
10679         * lib/basename.h, lib/execlp.c, lib/getpagesize.h, lib/mkdir.c:
10680         Remove these files.
10681         * lib/getstr.c, lib/getstr.h, lib/hash.h, lib/hash.h, lib/prepargs.c,
10682         lib/prepargs.h, lib/savedir.c, lib/savedir.h: New files.
10683         * lib/Makefile.am (EXTRA_DIST, noinst_HEADERS, libtar_a_SOURCES):
10684         Adjust to the above changes.
10685
10686         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove ../src/ansi2knr.
10687
10688         * src/open3.c: Remove.
10689
10690         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
10691         (tar_SOURCES): Remove open3.c.
10692         (INCLUDES): Remove -I.., as automake does that.
10693         (OMIT_DEPENDENCIES): ../lib/fnmatch.h -> fnmatch.h.  Add localedir.h.
10694
10695         The following changes are to put LOCALEDIR into localedir.h instead
10696         of passing it on the command line.
10697         (DEFS): Remove.
10698         (DISTCLEANFILES): New macro.
10699         (localedir.h): New rule.
10700         (rmt.o tar.o): Now depend on localedir.h.
10701
10702         * tests/delete02.sh, tests/extrac04.sh: New files.
10703
10704         * tests/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
10705         (TESTS): Add extrac04.sh, and restore delete02.sh.
10706         (DEFS): Remove; LOCALEDIR is now done via localedir.h.
10707         (INCLUDES): Remove -I.. as automake does this now.
10708
10709         * src/rtapelib.c (rexec): Don't declare unless using it.
10710         (do_command): Simplify signal-handling code slightly.
10711
10712         * src/delete.c (blocks_needed): Remove.  All uses changed to use
10713         blocking_factor - new_blocks.
10714         (acting_as_filter): New var.
10715         (write_record, delete_archive_members): Use acting_as_filter
10716         rather than archive == STDIN_FILENO to detect whether we're acting
10717         as a filter, as open can return STDIN_FILENO in some cases.
10718         (delete_archive_members): Ignore zero blocks if
10719         ignore_zeros_option is nonzero.  Fix bug that messed up last
10720         output block: write_eot can't be used here, as it gets confused
10721         when the input is at end of file.
10722
10723         * src/compare.c (diff_archive): Do not impose an arbitrary limit on
10724         symbolic link contents length.  Pass directory size to
10725         get_directory_contents.
10726
10727         * m4/decl.m4, m4/error.m4, m4/mbstate_t.m4, m4/prereq.m4,
10728         m4/strerror_r.m4: New files.
10729         * m4/signedchar.m4: Remove this file.
10730         * Makefile.am (ACINCLUDE_INPUTS): Adjust to above changes.
10731         * m4/Makefile.am (EXTRA_DIST): Likewise.
10732
10733         * Makefile.am (DISTCLEANFILES): Add intl/libintl.h.
10734
10735         * po/da.po: New translation file.
10736
10737         * src/mangle.c (extract_mangle):
10738         Fix diagnostic with wrong number of %s'es.
10739
10740         * lib/fnmatch.c (fnmatch):
10741         Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
10742         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
10743
10744         * lib/full-write.c (full_write): Some buggy drivers return 0 when you
10745         fall off a device's end.  Detect this.
10746
10747         * src/system.h (IN_CTYPE_DOMAIN): Renamed from CTYPE_DOMAIN.  All
10748         uses changed.
10749         (open): Remove macro; we no longer support EMUL_OPEN3.  Do not
10750         include <pathmax.h> and directory include files like <dirent.h>;
10751         no longer used.  Include <savedir.h> instead.
10752         (closedir, signed_char): remove macro; no longer used.
10753         (bool, false, true): Include <stdbool.h> if you have the include
10754         file, otherwise define.
10755
10756         * src/misc.c:
10757         (is_dot_or_dotdot, closedir_error, closedir_warn, opendir_error,
10758         opendir_warn, readdir_error): Remove; no longer needed.
10759         (safer_rmdir): Strip leading ./ (or .// or ./// or ././ or etc.)
10760         before deciding whether we're trying to remove ".".
10761         (remove_any_file): Try unlink first if we are not root.  Use
10762         savedir when recursively removing directories, to avoid exhausting
10763         file descriptors.
10764         (savedir_error, savedir_warn, symlink_error): New functions.
10765
10766         * src/list.c: (read_and): Do not invoke
10767         apply_nonancestor_delayed_set_stat; DO_SOMETHING is now
10768         responsible for that.  Do not invoke apply_delayed_set_stat; our
10769         caller is now responsible for that.
10770         (read_header): Use signed char instead of signed_char.  Prevent
10771         later references to current_header from mistakenly treating it as
10772         an old GNU header.
10773         (from_header): Quote invalid base-64 strings in diagnostics.
10774         (time_from_header): Do not warn about future timestamps in
10775         archive; check_time now does that.
10776         (print_header): Quote unknown file types.
10777         (skip_member): New function, replacing skip_extended_headers and
10778         now skipping the whole member instead of just the extended
10779         headers.  All callers changed.  This makes the code handle
10780         extended headers uniformly, and fixes some bugs.
10781
10782         * src/update.c (update_archive): Use skip_member.
10783
10784         * src/extract.c (we_are_root): Now global.
10785         (struct delayed_symlink): New type.
10786         (delayed_symlink_head): New var.
10787         (extr_init, fatal_exit): Invoke extract_finish on fatal errors,
10788         not apply_delayed_set_stat.
10789         (set_mode, set_stat): Pointer args are now const pointers.
10790         (check_time): New function.
10791         (set_stat): Warn if setting a file's timestamp to be the future.
10792         (make_directories): Do not save and restore errno.
10793         (maybe_recoverable): Set errno to ENOENT if we cannot make missing
10794         intermediate directories.
10795         (extract_archive): Invoke apply_nonancestor_delayed_set_stat here,
10796         not in caller.  Extract potentially dangerous symbolic links more
10797         carefully, deferring their creation until the end, and using a
10798         regular file placeholder in the meantime.  Do not remove trailing
10799         / and /. from file names.  Do not bother checking for ".." when
10800         checking whether a directory loops back on itself, as loopbacks
10801         can occur with symlinks too.  Also, in that case, do not bother
10802         saving and restoring errno; just set it to EEXIST.
10803         (apply_nonancestor_delayed_set_stat): A prefix is a potential
10804         ancestor if it ends in slash too (as well as ending in a char just
10805         before slash).
10806         (apply_delayed_set_stat): Remove.
10807         (apply_delayed_symlinks, extract_finish): New functions.
10808
10809         * doc/fdl.texi: New file.
10810         * doc/Makefile.am (EXTRA_DIST): Add fdl.texi.
10811         ($(srcdir)/tar.info): Add fdl.texi.  Invoke makeinfo with --no-split.
10812         * doc/tar.texi: Add Free Documentation License.  New section
10813         "Overwrite Old Files", and revamp that section to make it easier to
10814         follow.  "tar" -> "GNU tar" where appropriate.  Migrate getdate
10815         documentation into getdate.texi.  Fix several minor typos.  Describe
10816         TAR_OPTIONS.  Describe incompatibility between incremental backups and
10817         --atime-preserve.  Describe incompatibility between --verify and other
10818         options.  Mention that tar normally removes symbolic links rather than
10819         following them, when extracting a file of the same name.
10820
10821         * THANKS: Add gpoul.  Change skip's address.
10822
10823         * po/POTFILES.in: Add lib/human.c.
10824
10825         * src/common.h (namelist, namelast): Remove decls.
10826         (we_are_root, extract_finish, skip_member, savedir_error,
10827         savedir_warn, symlink_error, gnu_list_name): New decls.
10828         (apply_delayed_set_stat, apply_nonancestor_delayed_set_stat,
10829         skip_extended_headers, is_dot_or_dotdot, closedir_error,
10830         closedir_warn, opendir_error, opendir_warn, readdir_error,
10831         readdir_warn): Remove decls.
10832         (get_directory_contents): New off_t arg.
10833         (addname): Now returns struct name *.
10834
10835         * src/tar.h, tests/genfile.c: Fix comments.
10836
10837         * src/create.c: Include hash.h.
10838         (gnu_list_name): Remove decl.
10839         (struct link): Remove "next" member.
10840         (linklist): Remove.
10841         (start_header): Say "leading `FOO'" rather than "`FOO' prefix" for
10842         consistency with other diagnostics.
10843         (deal_with_sparse): Check for I/O error when closing the file.
10844         (create_archive): Do not allocate an array of size PATH_MAX, as
10845         PATH_MAX might be (size_t) -1.  Instead, allocate an array with
10846         the size that's needed.
10847         (hash_link, compare_links): New functions.
10848         (dump_file): Do not exhaust open file descriptors when descending
10849         deeply into a directory, by using savedir rather than
10850         opendir/readdir.  Do not zero-fill the name buffer unnecessarily.
10851         Hash the set of links already created, instead of using a linked
10852         list.  Fix some bugs in outputting sparse files which caused the
10853         sparse tables to be incorrect.  When a file unexpectedly shrinks,
10854         output zeros rather than garbage.  Do not allocate an array of
10855         size PATH_MAX, as PATH_MAX might be (size_t) -1.  Instead,
10856         allocate an array with the size that's needed.
10857
10858         * src/incremen.c: Include hash.h.
10859         (struct directory): Remove "next", "dir_text".  Change "name" to
10860         be char[1] with struct hack, not const char *.  Add "found".
10861         (directory_list): Remove.  Replaced by directory_table.
10862         (directory_table): New var.
10863         (nfs_string): Renamed from nfs.
10864         (hash_directory, compare_directories): New functions.
10865         (note_directory): Now returns struct directory *.  First arg is
10866         now const pointer.  struct stat arg is now dev_t, ino_t, nfs.
10867         Remove text arg.  New "found" arg, basically corresponding to the
10868         old text arg not being null.  All callers changed.
10869         (note_directory, find_directory): Use hash table rather than
10870         linked list.
10871         (get_directory_contents): New arg "device".  Use savedir to do the
10872         hard work.  Save the nfs-ness of stat_data, since it might change
10873         under us.  Use note_directory instead of find_directory to save
10874         some work.  When adding an "A" record, do it with
10875         add_to_accumulator instead of cheating with strcat.
10876         (read_directory_file): Use "+" flag before device to indicate
10877         whether it was NFS.  Fix typo in checking for strtoul error.
10878         (write_directory_file_entry): New function.
10879         (write_directory_file): Use it, and use the hash routines to
10880         traverse the directory table.
10881         (gnu_restore): Use savedir rather than opendir/readdir.
10882
10883         * src/tar.c: Include localedir.h, prepargs.h.
10884         (long_options): Now static.
10885         (long_options, usage, decode_options): -j is now short for
10886         --bzip2, and -I is now an alias for -T.
10887         (decode_options, main): argv is not const pointer now.
10888         (decode_options): Invoke prepend_default_options to support
10889         TAR_OPTIONS.  In diagnostic, mention the string that was the
10890         invalid blocking factor, tape length, group, owner, or record
10891         size.  --delete is no longer incompatible with -f -, undoing
10892         2000-01-07 change.
10893         (main): Invoke extract_finish at end of extraction.
10894
10895         * src/rmt.c: Include localedir.h.
10896         (main): Update copyright date to 2000.
10897
10898         * doc/getdate.texi: New file, taken from fileutils 4.0.27, with the
10899         following changes: Use @sc where appropriate.  Document the ranges of
10900         supported times more precisely.  Add Eggert to getdate authors.
10901         Document old Latin 12m/12pm tradition.  Remove list of alphabetic time
10902         zone names, as it wasn't correct and people shouldn't be relying on it
10903         anyway.  Relative items also account for non-DST adjustments.  Fix
10904         some misspellings.
10905
10906         * lib/prepargs.c, lib/prepargs.h, tests/extrac04.sh: New file.
10907
10908         * tests/ignfail.sh: opendir -> savedir in diagnostics.
10909
10910         * tests/preset.in: Set LANGUAGE to the empty string, for some
10911         brain damaged host.
10912
10913 2000-10-20  Paul Eggert  <eggert@twinsun.com>
10914
10915         * m4/fnmatch.m4: Mention the GNU C library.
10916
10917 2000-10-19  Paul Eggert  <eggert@twinsun.com>
10918
10919         * m4/fnmatch.m4: Add a couple more test cases to catch bugs in
10920         glibc 2.1.95.
10921
10922 2000-10-17  Paul Eggert  <eggert@twinsun.com>
10923
10924         * lib/human.c (<limits.h>): Do not include; human.h does it if needed.
10925         (CHAR_BIT): Remove.
10926
10927         * lib/human.h (<limits.h>): Include if HAVE_LIMITS_H.
10928         (CHAR_BIT): Define if not defined.
10929
10930 2000-09-09  Paul Eggert  <eggert@twinsun.com>
10931
10932         * lib/quotearg.c: From fileutils: rename ISASCII to IN_CTYPE_DOMAIN.
10933
10934 2000-08-07  Paul Eggert  <eggert@twinsun.com>
10935
10936         * lib/xmalloc.c: Memory exhausted -> memory exhausted
10937
10938         * lib/xalloc.h (xalloc_msg_memory_exhausted):
10939         change to array from char *.
10940
10941 2000-08-06  Paul Eggert  <eggert@twinsun.com>
10942
10943         * m4/mbstate_t.m4: Define mbstate_t to be int, not char, for
10944         compatibility with glibc 2.1.3 strftime.c.
10945
10946 2000-07-31  Paul Eggert  <eggert@twinsun.com>
10947
10948         * lib/quotearg.c (quotearg_n_options):
10949         Don't make the initial slot vector a constant,
10950         since it might get modified.
10951
10952         * lib/quotearg.c: Add support for more than one preallocated slot.
10953
10954 2000-07-30  Paul Eggert  <eggert@twinsun.com>
10955
10956         * lib/quotearg.c (quotearg_n_options):
10957         Preallocate a slot 0 buffer, so that the caller
10958         can always quote one small component of a "memory exhausted" message
10959         in slot 0.
10960
10961 2000-07-23  Paul Eggert  <eggert@twinsun.com>
10962
10963         * lib/quotearg.c:
10964         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX), so that
10965         mbstate_t is always defined.
10966
10967         Do not inspect MB_LEN_MAX, since it's incorrectly defined to be 1 in
10968         some GCC installations, and this configuration error is likely to be
10969         common.
10970
10971 2000-07-22  Paul Eggert  <eggert@twinsun.com>
10972
10973         * lib/quotearg.c:
10974         When the system forces us to redefine mbstate_t, shadow its mbsinit
10975         function.  From Bruno Haible.
10976
10977 2000-07-14  Paul Eggert  <eggert@twinsun.com>
10978
10979         * lib/xmalloc.c: Simplify exhausted message.
10980
10981         * lib/quotearg.h: Update copyright date; from Jim Meyering.
10982
10983 2000-07-13  Paul Eggert  <eggert@twinsun.com>
10984
10985         * lib/quotearg.h (enum quoting style):
10986         New constant clocale_quoting_style.
10987
10988         * lib/quotearg.c:
10989         (quoting_style_args, quoting_style_vals, quotearg_buffer_restyled):
10990         Add support for clocale_quoting_style, undoing previous change to
10991         locale_quoting_style.
10992
10993 2000-07-10  Paul Eggert  <eggert@twinsun.com>
10994
10995         * lib/quotearg.c:
10996         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX,
10997         since otherwise we don't need it.
10998         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
10999         since we don't do multibytes in that case.
11000         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
11001         invoke multibyte primitives.
11002
11003         * m4/mbstate_t.m4 (AC_MBSTATE_T):
11004         Renamed from AC_MBSTATE_T_OBJECT.  All uses changed.
11005         Change from a two-part test, which defines both HAVE_MBSTATE_T_OBJECT
11006         and mbstate_t, to a single-part test that simply defines mbstate_t.
11007
11008         * lib/quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
11009         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
11010         to decide whether to define the BeOS workaround macro;
11011         this adjusts to the change to AC_MBSTATE_T.
11012
11013         * m4/strerror_r.m4: New file.
11014
11015 2000-07-05  Paul Eggert  <eggert@twinsun.com>
11016
11017         * lib/quotearg.c: Use double-quote to quote.
11018
11019         * lib/quotearg.c (N_): New macro.
11020         (gettext_default): New function.
11021         (quotearg_buffer_restyled): Use gettext_default ("{LEFT QUOTATION MARK}",
11022         "\"") for left quote, and gettext_default ("{RIGHT QUOTATION MARK}", "\"")
11023         for right quote.
11024
11025         * lib/quotearg.c (struct quoting_options):
11026         Simplify quote_these_too dimension.
11027         From Bruno Haible  <haible@clisp.cons.org>.
11028
11029         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT):
11030         Test for mbstate_t only if the test
11031         for an object-type mbstate_t fails.
11032
11033         * lib/quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
11034
11035 2000-07-03  Paul Eggert  <eggert@twinsun.com>
11036
11037         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT): Port to autoconf 2.13.
11038         Add AC_CHECK_HEADERS(stdlib.h), since we use HAVE_STDLIB_H.
11039
11040         * lib/quotearg.c (mbrtowc):
11041         Assign to *pwc, and return 1 only if result is nonzero.
11042         (iswprint): Define to ISPRINT if we are substituting our own mbrtowc.
11043
11044 2000-07-02  Paul Eggert  <eggert@twinsun.com>
11045
11046         * lib/quotearg.c (mbstate_t):
11047         Do not define; it should be defined with AC_CHECK_TYPE.
11048
11049 2000-06-26  Paul Eggert  <eggert@twinsun.com>
11050
11051         * m4/mbstate_t.m4: Include stdio.h before wchar.h, to work around
11052         a bug in glibc 2.1.3.
11053
11054         * lib/xmalloc.c: Fix inaccurate comment for xrealloc.
11055
11056 2000-06-19  Paul Eggert  <eggert@twinsun.com>
11057
11058         * lib/quotearg.c (ISASCII): Add #undef and move definition to follow
11059         inclusion of wctype.h to work around solaris2.6 namespace pollution.
11060         (ISPRINT): Likewise.
11061         Reported by Tom Tromey.
11062
11063 2000-06-15  Paul Eggert  <eggert@twinsun.com>
11064
11065         * lib/human.c (adjust_value): New function.
11066         (human_readable_inexact): Apply rounding style even when printing
11067         approximate values.
11068
11069         * lib/human.c: Avoid shadowing warnings.
11070         From Jim Meyering.
11071
11072 2000-06-14  Paul Eggert  <eggert@twinsun.com>
11073
11074         * lib/human.c (human_readable_inexact): Allow an input block size
11075         that is not a multiple of the output block size, and vice versa.
11076
11077         * lib/getdate.y (get_date): Apply relative times after time zone
11078         indicator, not before.
11079
11080 2000-05-31  Paul Eggert  <eggert@twinsun.com>
11081
11082         * m4/largefile.m4: Rewrite so that we don't need to run getconf,
11083         and thus don't need AC_CANONICAL_HOST.
11084
11085         (AC_SYS_LARGEFILE_FLAGS, AC_SYS_LARGEFILE_SPACE_APPEND): Remove.
11086         (AC_SYS_LARGEFILE_TEST_INCLUDES): New macro.
11087         (AC_SYS_LARGEFILE_MACRO_VALUE): Change arguments from
11088         CODE-TO-SET-DEFAULT to VALUE, INCLUDES, FUNCTION-BODY.  All uses
11089         changed.  Instead of inspecting the output of getconf, try to
11090         compile the test program without and with the macro definition.
11091         (AC_SYS_LARGEFILE): Do not require AC_CANONICAL_HOST or check for
11092         getconf.  Instead, check for the needed flags by compiling test
11093         programs.
11094
11095         * configure.in (AC_CANONICAL_HOST): Remove; the largefile stuff no
11096         longer needs it.
11097         * config.guess, config.sub: Remove these files, for similar reasons.
11098
11099 2000-05-03  Paul Eggert  <eggert@twinsun.com>
11100
11101         * m4/largefile.m4 (AC_SYS_LARGEFILE): Define _XOPEN_SOURCE to be
11102         500, instead of _GNU_SOURCE to be 1, to work around glibc 2.1.3
11103         bug.  This avoids a clash when files like regex.c that define
11104         _GNU_SOURCE.
11105
11106 2000-05-02  Paul Eggert  <eggert@twinsun.com>
11107
11108         * m4/largefile.m4 (AC_SYS_LARGEFILE):
11109         Define _GNU_SOURCE if this is needed to make
11110         ftello visible (e.g. glibc 2.1.3).  Use compile-time test, rather than
11111         inspecting host and OS, to decide whether to define _LARGEFILE_SOURCE.
11112
11113         * lib/quotearg.c (mbrtowc, mbstat_t):
11114         Add definitions if !HAVE_MBSTATE_T_OBJECT.
11115         (<wctype.h>): Include if HAVE_WCTYPE_H.
11116         (iswprint): Define to 1 if we lack it
11117
11118 2000-04-18  Paul Eggert  <eggert@twinsun.com>
11119
11120         * m4/mbstate_t.m4: New file.
11121
11122 2000-04-17  Bruno Haible  <haible@clisp.cons.org>
11123
11124         * tests/ignfail.sh: Test for uid 0 along with user "root".
11125
11126 2000-04-05  Paul Eggert  <eggert@twinsun.com>
11127
11128         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS):
11129         Don't use -n32 on IRIX if the installer said
11130         otherwise.
11131
11132 2000-02-28  Paul Eggert  <eggert@twinsun.com>
11133
11134         * lib/quotearg.c (ALERT_CHAR): New macro.
11135         (quotearg_buffer_restyled): Use it.
11136
11137 2000-02-23  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
11138
11139         * src/list.c (tartime): Fix off-by-one error when copying year if
11140         OLD_CTIME.
11141
11142 2000-02-18  Paul Eggert  <eggert@twinsun.com>
11143
11144         * lib/getdate.y: Handle two-digit years with leading zeros correctly.
11145         (textint): New typedef.
11146         (parser_control): Changed from struct parser_control to typedef
11147         (for consistency).  Member year changed from int to textint.  All
11148         uses changed.
11149         (YYSTYPE): Removed; replaced by %union with int and textint
11150         members.
11151         (tID): Removed; not used.
11152         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE,
11153         tMERIDIAN, tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER,
11154         tUNUMBER, tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
11155         (tSNUMBER, tUNUMBER): Now of type <textintval>.
11156         (date, number, to_year): Use width of number in digits, not its
11157         value, to determine whether it's a 2-digit year, or a 2-digit
11158         time.
11159         (yylex): Store number of digits of numeric tokens.  Return '?' for
11160         unknown identifiers, rather than (unused) tID.
11161
11162 2000-01-16  Paul Eggert  <eggert@twinsun.com>
11163
11164         * lib/quotearg.c (quotearg_buffer_restyled):
11165         Do not quote alert, backslash, formfeed,
11166         and vertical tab unnecessarily in shell quoting style.
11167
11168 2000-01-15  Paul Eggert  <eggert@twinsun.com>
11169
11170         * m4/c-bs-a.m4:
11171         Change quoting to be compatible with future autoconf versions.
11172
11173 2000-01-11  Paul Eggert  <eggert@twinsun.com>
11174
11175         * lib/exclude.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove unused macros.
11176
11177 2000-01-07  Paul Eggert  <eggert@twinsun.com>
11178
11179         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.17.
11180
11181         Fix bug with fnmatch.h dependency, as follows:
11182         * src/Makefile.am (OMIT_DEPENDENCIES): New macro.
11183         * lib/Makefile.am (OMIT_DEPENDENCIES): New macro.
11184
11185         * src/common.h (apply_nonancestor_delayed_set_stat):
11186         Renamed from apply_delayed_set_stat.
11187         (apply_delayed_set_stat, decode_mode, chmod_error_details,
11188         chown_error_details, close_warn, closedir_warn, mkdir_error,
11189         read_error_details, read_fatal_details, read_warn_details,
11190         seek_error_details, seek_warn_details, utime_error,
11191         write_error_details, write_fatal_details): New decls.
11192
11193         Make diagnostic messages more regular.
11194         * src/create.c (dump_file): Quote file names with colons if possible.
11195         * src/compare.c (diff_archive): Likewise.
11196         * src/extract.c (repair_delayed_set_stat, extract_archive): Likewise.
11197         * src/incremen.c (get_directory_contents, gnu_restore): Likewise.
11198         * src/mangle.c (extract_mangle): Likewise.
11199         * src/misc.c (call_arg_error, call_arg_fatal, call_arg_warn):
11200         Likewise.
11201         * src/buffer.c (archive_write_error, flush_archive, close_archive,
11202         new_volume, xclose):
11203         Use error message functions to report errors consistently.
11204         * src/compare.c (diff_sparse_files, diff_archive): Likewise.
11205         * src/create.c (finish_sparse_file, dump_file): Likewise.
11206         * src/extract.c (set_mode, set_stat, extract_sparse_file,
11207         extract_archive): Likewise.
11208         * src/list.c (list_archive): Likewise.
11209         * src/update.c (append_file): Likewise.
11210         * src/compare.c (diff_init, diff_sparse_files):
11211         Use xalloc_die to report memory exhaustion.
11212         * src/incremen.c (gnu_restore): Likewise.
11213         * src/list.c (read_header): Likewise.
11214         * src/mangle.c (extract_mangle): Likewise.
11215         * src/misc.c (maybe_backup_file): Likewise.
11216         * src/tar.c (decode_options): Likewise.
11217         * src/compare.c (read_and_process, fill_in_sparse_array,
11218         diff_sparse_files):
11219         Use consistent terminology for unexpected-EOF message.
11220         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
11221         * src/list.c (list_archive, read_header, skip_file,
11222         skip_extended_headers): Likewise.
11223         * src/buffer.c (archive_write_error): Add noreturn attribute to decl.
11224         (xdup2): Regularize messages with rest of tar.
11225
11226         * src/buffer.c (flush_read): Don't read past EOF.
11227
11228         * src/extract.c (extr_init):
11229         If we run out of memory, invoke apply_delayed_set_stat.
11230         (prepare_to_extract): Don't complain if we can't remove ".".
11231         (apply_delayed_set_stat): New function.
11232         (apply_nonancestor_delayed_set_stat):
11233         Renamed from apply_delayed_set_stat.  All uses changed.
11234         Don't remove head if it doesn't apply.
11235
11236         * src/create.c (find_new_file_size):
11237         Return size instead of storing through pointer.
11238         All callers changed.
11239         (deal_with_sparse): Don't keep reading after read errors.
11240         (finish_sparse_file): Just abort if there is an internal error.
11241         (dump_file): Fix typo: stat_warn and stat_error were interchanged.
11242         Don't restore access times on directories during incremental dumps
11243         until after dealing with the directory.
11244         If ignoring failed reads, count closedir, read, and unknown
11245         file errors as warnings, not errors.
11246         Fix buffer overrun problem when dumping sparse files.
11247
11248         * src/list.c (read_and):
11249         Invoke apply_nonancestor_delayed_set_stat on file names
11250         after handling them.
11251         (decode_mode): Remove; moved to misc.c.
11252
11253         * src/misc.c (safer_rmdir): New function.
11254         (remove_any_file): Use it to avoid problems with rmdir(".").
11255         (maybe_backup_file): Regularize diagnostics.
11256         (undo_backup_file): Likewise.
11257         (decode_mode): Moved here from list.c.
11258         (chmod_error_details, chown_error_details, close_fatal,
11259         close_warn, closedir_warn, mkdir_error, read_error_details,
11260         read_warn_details, read_fatal_details, seek_error_details,
11261         seek_warn_details, utime_error, write_error_details,
11262         write_fatal_details): New functions.
11263
11264         * src/delete.c (save_record): Remove static variable (now local).
11265         (move_archive): Don't position before start of archive.
11266         (write_record): Abort if count is zero at inopportune time.
11267         Plug memory leak.
11268
11269         * src/tar.c (decode_options): --delete and -f - are now
11270         incompatible, since we didn't have time to fix their bugs.
11271
11272         * tests/Makefile.am (TESTS): Remove delete02.sh.
11273         * tests/ignfail.sh: Adjust to new quoting scheme again.
11274
11275 2000-01-06  Paul Eggert  <eggert@twinsun.com>
11276
11277         * lib/getdate.y: Sync tm_diff with the GNU C Library.
11278         (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN.  All uses changed.
11279         (tm_diff): Renamed from difftm.  All uses changed.
11280         Replace body with that taken from GNU C Library 2.1.3pre1.
11281         (get_date): Prefer tm_gmtoff to tm_diff if available.
11282
11283 1999-12-29  "Melissa O'Neill"  <oneill@cs.sfu.ca>
11284
11285         * tests/incremen.sh: Invoke stat on newly created file so that its
11286         ctime is updated on Nextstep.
11287
11288 1999-12-21  Machael Stone  <mstone@cs.loyola.edu>
11289
11290         * lib/getdate.y (get_date):
11291         Fix typo when checking for time_t overflow in time zone calculations.
11292
11293 1999-12-13  Paul Eggert  <eggert@twinsun.com>
11294
11295         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.16.
11296
11297         * README-alpha: New file.
11298         * README: New sections for gzip and bzip2, Solaris.
11299         Remove mention of BACKLOG.
11300
11301         * configure.in (AC_C_BACKSLASH_A): Add.
11302         (AC_CHECK_HEADERS): Add wchar.h.
11303         (AC_CHECK_FUNCS): Add mbrtowc.
11304         (AC_FUNC_CLOSEDIR_VOID): Add.
11305
11306         * tests/Makefile.am (TESTS): Add delete02.sh.
11307         (POSTPONED_TESTS): Remove.
11308         (EXTRA_DIST): Remove $(POSTPONED_TESTS).
11309
11310         * tests/preset.in:
11311         Set LC_ALL rather than LANGUAGE, LANG, and LC_MESSAGES.
11312
11313         * tests/ignfail.sh (err): Adjust to new quoting scheme.
11314
11315         * tests/delete02.sh: Fix typo: need to list archive2, not archive.
11316
11317         * tests/extrac03.sh: Use -P option, so that .. doesn't get diagnosed.
11318
11319         * src/tar.c ("quotearg.h"): New include.
11320         (usage): Now has __attribute__ ((noreturn)).
11321         (confirm): Report errno if we can't open tty.
11322         (confirm, decode_options):
11323         Quote arbitrary strings in diagnostics.
11324         (OVERWRITE_OPTION): New constant.
11325         (long_options, usage, decode_options): New --overwrite option.
11326         (decode_options): --keep-old-files, --overwrite, and --unlink-first
11327         are now mutually exclusive.
11328         Don't assume that gettext preserves errno.
11329         (main): Set default quoting style to escape_quoting_style.
11330
11331         * src/update.c (<quotearg.h>): New include.
11332         (append_file):
11333         Don't assume that gettext preserves errno.
11334         Quote arbitrary strings in diagnostics.
11335         Check for close error.
11336
11337         * src/names.c (<quotearg.h>): New include.
11338         (name_init, name_next, name_close, names_notfound,
11339         collect_and_sort_names): Don't assume that gettext preserves
11340         errno.  Quote arbitrary strings in diagnostics.
11341         (excluded_name): Fix typo that caused empty patterns to be
11342         mishandled.
11343
11344         * src/misc.c (<quotearg.h>): New include.
11345         (quote_copy_string): Quote only newline and backslash; the output is no
11346         longer meant for humans, and is locale-independent.
11347         (contains_dot_dot): New function.
11348         (remove_any_file): Don't use lstat; just rmdir the file and then use
11349         unlink if the rmdir fails because the file isn't a directory.
11350         Check for readdir and closedir errors.
11351         (maybe_backup_file): Report "stat" for stat errors.
11352         (maybe_backup_file, chdir_do):
11353         Quote arbitrary strings in diagnostics.
11354         (maybe_backup_file, undo_last_backup):
11355         Don't assume that gettext preserves errno.
11356         (call_arg_error, call_arg_fatal, call_arg_warn,
11357         chdir_fatal, close_error, closedir_error, exec_fatal, mkfifo_error,
11358         mknod_error, open_error, open_fatal, open_warn, opendir_error,
11359         opendir_warn, read_error, read_fatal, readdir_error, readdir_warn,
11360         readlink_error, readlink_warn, seek_error, seek_warn, stat_error,
11361         stat_warn, truncate_error, truncate_warn, unlink_error, waitpid_error,
11362         write_error, write_fatal, xfork, xpipe, quote_n, quote): New functions.
11363
11364         * src/system.h (__attribute__): New macro.
11365         (O_NDELAY, O_NONBLOCK, O_APPEND): Remove.
11366         (S_ISDOOR): New macro.
11367         (closedir): New macro, if CLOSEDIR_VOID.
11368
11369         * src/rmt.c, src/rtapelib.c (decode_oflag):
11370         O_APPEND might not be defined.
11371
11372         * src/list.c: (read_and, list_archive):
11373         Quote arbitrary strings in diagnostics.
11374         (from_header): Use locale_quoting_style to quote diagnostics.
11375         (print_header, print_for_mkdir): Quote with quotearg, not quote_copy_string.
11376
11377         * src/rmt.h (REM_BIAS): Increase from 128 to (1 << 30).
11378
11379         * src/Makefile.am: Use ## for copyright comments.
11380
11381         * src/extract.c (<quotearg.h>): New include.
11382         (enum permstatus): New enum.
11383         (struct delayed_set_stat): file_name is now at end of buffer, to avoid
11384         two mallocs.  New members file_name_len, invert_permissions, permstatus.
11385         (extr_init): Remove hack that silently adjusted newdir_umask.
11386         (set_mode, set_stat): New args invert_permissions, permstatus, typeflag.
11387         Use these args to decide whether and how to set modes.
11388         (set_mode, set_stat, prepare_to_extract, extract_sparse_file, extract_archive):
11389         Don't assume that gettext preserves errno.
11390         (set_stat): Remove arg symlink_flag; subsumed by typeflag.
11391         (delay_set_stat, repair_delayed_set_stat): New functions.
11392         (make_directories): Avoid mkdir where last part of path is "..".
11393         Create a struct delayed_set_stat for each directory made.
11394         (prepare_to_extract): Renamed from unlink_destination, and
11395         return 0 immediately if to_stdout_option; all callers changed.
11396         (maybe_recoverable): New parameter interdir_made.
11397         Add support for --overwrite.
11398         (extract_sparse_file, extract_archive):
11399         Quote arbitrary strings in diagnostics.
11400         (extract_archive): By default, warn about ".." in member names, and skip them.
11401         Don't open files with O_NONBLOCK or O_APPEND.
11402         Open with O_TRUNC only if --overwrite; otherwise, use O_EXCL to avoid
11403         overwriting them.  Pass only rwxrwxrwx permissions to `open' and `mkdir',
11404         minus the current umask.  Keep track of intermediate directories made,
11405         to avoid looping when making x/../x when x doesn't exist; the
11406         earlier code solved this in a different way that didn't fit well
11407         into the new scheme.  Don't extract permissions onto existing
11408         directories unless --overwrite is given.  Do not add -wx------
11409         permissions to new directories permanently; just do it temporarily.
11410         Remove no-longer-needed hack with MSDOS and directory time stamps.
11411         (apply_delayed_set_stat): New argument specifies which directories to
11412         fix statuses of.  Do not wait until the end of extraction to fix
11413         statuses; instead, fix a directory's status once we exit that directory.
11414         This requires less memory and does the right thing in some cases
11415         where the old method didn't.
11416         (fatal_exit): New function.
11417
11418         * src/incremen.c (<quotearg.h>): New include.
11419         (get_directory_contents, gnu_restore):
11420         Check for readdir and closedir errors.
11421         (get_directory_contents, read_directory_file, gnu_restore):
11422         Quote arbitrary strings in diagnostics.
11423         (get_directory_contents, read_directory_file, write_directory_file):
11424         Don't assume that gettext preserves errno.
11425
11426         * src/create.c (<quotearg.h>): New include.
11427         (start_header): Use `member names' to refer to archive member names, not
11428         `archive names'.  Warn about `..' in member names.
11429         (finish_sparse_file, dump_file):
11430         Quote arbitrary strings in diagnostics.
11431         (finish_sparse_file, dump_file):
11432         Don't assume that gettext preserves errno.
11433         (dump_file): Don't use `access' to determine whether a directory is readable;
11434         this isn't reliable if tar is setuid.  Use `opendir' instead.
11435         Check for readdir and closedir failures.
11436         Don't dump sockets as if they were fifos; just warn and skip.
11437
11438         * src/delete.c (move_archive):
11439         Don't report fatal error merely because sizes don't fit
11440         into struct mtop values; fall back on lseek instead.
11441         Say `Cannot' uniformly, instead of `Could not' sometimes and `Cannot' others.
11442         Say `reposition' instead of `re-position'.
11443         (delete_archive_members):
11444         Set archive to STDOUT_FILENO before outputting trailing buffer.
11445
11446         * src/compare.c (<quotearg.h>): New include.
11447         (diff_init): Use `Cannot' uniformly, instead of `Could not' sometimes
11448         and `Cannot' others.
11449         (report_difference, diff_archive):
11450         Quote arbitrary strings in diagnostics.
11451         (process_rawdata, diff_sparse_files, get_stat_data, diff_archive, seek_warn):
11452         Don't assume that gettext preserves errno.
11453         (diff_archive): Don't open regular files with O_NONBLOCK.
11454         Preserve access times of files if --atime.
11455
11456         * src/common.h (FATAL_ERROR): Use new fatal_exit function to exit.
11457         (FATAL_ERROR, USAGE): Don't return 0.
11458         (enum old files): New enum.
11459         (old_files_option): New variable, replacing keep_old_files_option and
11460         unlink_first_option.
11461         (apply_delayed_set_stat): Now takes char const * param.
11462         (fatal_exit, contains_dot_dot, chdir_fatal, close_error,
11463         closedir_error, exec_fatal, mkfifo_error, mknod_error, open_error,
11464         open_fatal, open_warn, opendir_error, opendir_warn, read_error,
11465         read_fatal, readdir_error, readdir_warn, readlink_error,
11466         readlink_warn, seek_error, seek_warn, stat_error, stat_warn,
11467         truncate_error, truncate_warn, unlink_error, waitpid_error,
11468         write_error, write_fatal, xfork, xpipe, quote, quote_n): New decls.
11469
11470         * src/buffer.c:
11471         (xclose, xdup2, child_open_for_compress, child_open_for_uncompress,
11472         archive_write_error, archive_read_error, flush_archive, close_archive,
11473         init_volume_number, new_volume):
11474         Don't assume that gettext preserves errno.
11475
11476         (xdup2): Don't report errno if dup returns an unexpected nonnegative value.
11477         (open_archive): Reject multivolume verify attempts a bit earlier.
11478         Rename local variable `access', in case it's defined by system header.
11479
11480         (open_archive, backspace_output): Use `Cannot' uniformly, instead of
11481         `Could not' sometimes and `Cannot' others.
11482
11483         (open_archive, flush_read, flush_archive, close_archive, new_volume):
11484         Quote arbitrary strings in diagnostics.
11485
11486         (read_error): Set archive to STDOUT_FILENO temporarily when writing
11487         archive buffer.
11488
11489         (init_volume_number): Check for input and output errors in volno_file.
11490
11491         (new_volume): Use new fatal_exit function to exit, and new xfork
11492         function to fork.
11493
11494         * m4/Makefile.am (EXTRA_DIST): Add c-bs-a.m4.
11495
11496         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/c-bs-a.m4.
11497
11498         * doc/tar.texi: Add --overwrite.
11499         --absolute-names rejects ".." in names.
11500
11501         * lib/quotearg.c: Add support for multibyte characters.
11502         (ISGRAPH): Remove.
11503         (ISPRINT): New macro.
11504         (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
11505         (isprint, mbrtowc, mbsinit, mbstate_t): New macros,
11506         defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
11507         (quotearg_buffer_restyled): New function, with most of the old
11508         quotearg_buffer's contents.
11509         Major rewrite to support multibyte characters.
11510         (quotearg_buffer): Now just calls quotearg_buffer_restyled.
11511
11512         * m4/c-bs-a.m4: New file.
11513
11514         * lib/Makefile.am: Use ## for copyright notice.
11515
11516         * scripts/Makefile.am: Use ## on copyright notice.
11517
11518         * doc/Makefile.am:
11519         ($(srcdir)/tar.info, tar.dvi): We now use texinfo 4.0.
11520
11521 1999-12-05  Paul Eggert  <eggert@twinsun.com>
11522
11523         * doc/ChangeLog, lib/ChangeLog, scripts/ChangeLog,
11524         src/ChangeLog, tests/ChangeLog: Remove these files.
11525         * ChangeLog.1: New file, incorporating the above files, plus old
11526         ChangeLog entries.
11527         * Makefile.am (EXTRA_DIST): Add ChangeLog.1.
11528
11529 1999-12-05  Dale Worley  <worley@ariadne.com>
11530
11531         * src/compare.c (<utime.h>, struct utimbuf): Add.
11532         (diff_archive): Restore access times if --atime.
11533         * doc/tar.texi: Explain that --atime also preserves modification time.
11534
11535 1999-12-04  Gerhard Poul  <gpoul@gnu.org>
11536
11537         * ABOUT-NLS: Update to latest version from ftp.gnu.org.
11538         * BACKLOG, TODO: Remove.
11539         * Makefile.am (all-local, BABYL, dist-zoo, id, ID): Remove.
11540         * README: Bring up to date.
11541
11542 1999-12-03  Paul Eggert  <eggert@twinsun.com>
11543
11544         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.15.
11545
11546         * src/compare.c (diff_archive):
11547         Do not set errno to EPIPE; we no longer use perror.
11548
11549         * src/create.c (dump_file):
11550         If a parent directory said that a file should be there but it is
11551         absent, diagnose it as being removed in the meantime.
11552         Do not pass meaningless errno to ERROR when reporting that the
11553         file changed as we read it.
11554         Report that a file changed if its ctime changes; this is more
11555         sensitive than mtime+size, and more accurate.
11556
11557         * src/incremen.c (enum children): New type.
11558         (struct directory): Change old char allnew member to new enum children
11559         children member.
11560         All uses changed.
11561         (get_directory_contents): When doing an incremental dump that does
11562         not cross filesystem boundaries, dump the mount points, even though
11563         they are in a different filesystem.  This is for convenience when
11564         restoring, and for consistency with non-incremental dumps.
11565         This requires a 3-way flag for keeping track of which children we want,
11566         so we use enum children rather than boolean.
11567
11568         * src/open3.c (modes): Remove.
11569         (open3): Remove unportable assumptions about flag encodings.
11570         Use `stat' instead of `access' for testing file existence,
11571         to avoid problems with setuid programs.
11572
11573         * src/names.c (name_next): If file names are given both in the
11574         command line (e.g. via -C) and in a file (via -T), do not
11575         ignore the command-line names.
11576
11577         * m4/uintmax_t.m4: Backport to autoconf 2.13.
11578
11579         * doc/tar.texi: Clarify getdate authorship.
11580
11581 1999-11-23  Paul Eggert  <eggert@twinsun.com>
11582
11583         * lib/Makefile.am (DISTCLEANFILES): New macro.
11584
11585         * configure.in (tar_fnmatch_hin):
11586         Remove; it runs afoul of a bug in autoconf 2.13.
11587         Instead, always link fnmatch.h to some file, even if it's a throwaway.
11588
11589 1999-11-19  Paul Eggert  <eggert@twinsun.com>
11590
11591         * m4/largefile.m4: Update serial.
11592
11593 1999-11-18  Paul Eggert  <eggert@twinsun.com>
11594
11595         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a bug in
11596         the QNX shell, which doesn't propagate exit status of failed
11597         commands inside shell assignments.
11598
11599 1999-11-07  Paul Eggert  <eggert@twinsun.com>
11600
11601         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.14.
11602
11603         * configure.in (AC_PREREQ): Bump to 2.13.
11604         (ALL_LINGUAS): Add pt_BR, ja.
11605         (AC_FUNC_FNMATCH): Remove lib/funmatch.h before invoking, not after.
11606         (tar_cv_path_RSH): Prefer a non-symlink rsh to a symlink one,
11607         for AIX crossbuilds.
11608
11609         * doc/tar.texi: New node create options for --ignore-failed-read.
11610         Remove unused version control symbols.
11611         Modernize texinfo usage.
11612
11613         * src/tar.c (usage): Add examples.
11614
11615         * m4/fnmatch.m4 (AC_FUNC_FNMATCH):
11616         Include fnmatch.h when testing fnmatch.
11617
11618         * src/common.h (collect_and_sort_names): New decl.
11619
11620         * src/list.c (from_header):
11621         Handle 32-bit two's complement negative time stamps
11622         even if the leading octal digit is 2 or 3.
11623
11624         * src/extract.c (set_stat): Remove duplicate code.
11625
11626         * src/create.c (to_chars): Remove trailing newline from warning.
11627         (dump_file): Ignore doors.
11628         (finish_header): Report block numbers with origin 0, not origin 1.
11629
11630         * src/rmt.c: Include getopt.h.
11631         (long_opts): New constant.
11632         (usage): New function.
11633         (main): Implement --help and --version.
11634         Output usage message if arguments are bad.
11635
11636 1999-10-10  Paul Eggert  <eggert@twinsun.com>
11637
11638         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.13.
11639
11640         * README: Remove --with-dmalloc.
11641         Add --disable-largefile.
11642         Remove old NeXT dirent problems, or AIX valloc problems.
11643         Remove old union wait advice, and old %lld advice.
11644         Remove advice about FreeBSD 2.1.7, ISC 4.1mu, Ultrix `make'.
11645
11646         * doc/tar.texi: Clarify documentation for portable file names.
11647
11648         * configure.in (AM_WITH_DMALLOC): Remove.
11649         (ALL_LINGUAS): Add ja.
11650
11651         * src/tar.c (decode_options):
11652         Invalid dates are now treated as (time_t) -1.
11653         Redo version message to conform to GNU standards.
11654
11655         * src/create.c (dump_file):
11656         Fix typo: last two args to dump_file were interchanged.
11657         * src/update.c (update_archive): Likewise.
11658
11659         * src/common.h (tartime): New decl.
11660
11661         * src/list.c (tartime): Now extern.
11662         (read_and): Invalid headers cause errors, not warnings.
11663
11664 1999-10-03  Paul Eggert  <eggert@twinsun.com>
11665
11666         * lib/getdate.y (__attribute__):
11667         Don't use if GCC claims to be before 2.8; this is
11668         needed for OPENStep 4.2 cc.  Also, don't use if strict ANSI.
11669
11670 1999-09-25  Paul Eggert  <eggert@twinsun.com>
11671
11672         * lib/fnmatch.c, lib/fnmatch.hin: Merge changes from latest glibc.
11673         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Likewise.
11674
11675         * tests/incremen.sh: Add yet another sleep.
11676
11677 1999-09-24  Paul Eggert  <eggert@twinsun.com>
11678
11679         * NEWS: A read error now causes a nonzero exit status.
11680
11681         * src/create.c (to_chars): Fix base-256 output.
11682
11683         * src/buffer.c (write_error):
11684         Read error is an error, not just a warning.
11685
11686 1999-09-24  Paul Eggert  <eggert@twinsun.com>
11687
11688         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.12.
11689
11690         * src/tar.c (<time.h>): Include.
11691         (time): Declare if not defined.
11692         (confirm): Don't read past EOF.
11693         (long_options, usage): Add --no-same-owner, --no-same-permissions.
11694         (main): Use clock_gettime if available.
11695
11696         * tests/Makefile.am (TESTS): Add incremen.sh
11697         (INCLUDES): Add -I../lib, for fnmatch.h.
11698
11699         * src/update.c (update_archive):
11700         Remove call to name_expand; had no effect.
11701         Use chdir_do to change into directory.
11702         Use deref_stat instead of stat.
11703         Use add_avoided_name to mark names to be avoided; the old method of
11704         setting a bit with the name caused all descendants of that name to
11705         be avoided, in some circumstances.
11706
11707         * tests/incremen.sh: Remove unnecessary sleeps.
11708
11709         * src/names.c (name_next): Go back to using plain chdir.
11710         (name_gather): Use chdir_arg to keep track of arguments to chdir.
11711         (addname): Likewise.
11712         (name_match): Use chdir_do to act on chdir args.
11713         (merge_sort): Moved here from incremen.c.
11714         (compare_names, add_hierarchy_to_namelist, collect_and_sort_names):
11715         Likewise.
11716         (name_expand): Remove.
11717         (name_from_list): Skip fake names.
11718         Use chdir_do to act on chdir args.
11719         (struct avoided_name): New struct.
11720         (avoided_names): New var.
11721         (add_avoided_name, is_avoided_name): New functions.
11722
11723         * src/system.h (stat, lstat): Define in terms of statx on
11724         STX_HIDDEN && !_LARGE_FILES /* AIX */ hosts.
11725         (UCHAR_MAX): New macro.
11726         (TYPE_MAXIMUM): Cast to arg type, for types narrow than int.
11727
11728         * m4/largefile.m4: Work around GCC 2.95.1 bug with HP-UX 10.20.
11729
11730         * src/incremen.c (<time.h>): Remove include; no longer used.
11731         (time): Remove decl.
11732         (time_now): Remove.
11733         (get_directory_contents): Use deref_stat.
11734         Consider a subdirectory to be all new only if
11735         listed_incremental_option or if it its timestamp is newer than the
11736         cutoff.
11737         (add_hierarchy_to_namelist, merge_sort): Move to names.c.
11738         (read_directory_file): Now extern.  Do not set time_now.
11739         (write_directory_file): Renamed from write_dir_file.
11740         Use start_time instead of time_now.
11741         (compare_names, collect_and_sort_names): Move to names.c.
11742
11743         * src/mangle.c (<time.h>): Remove; not used.
11744         (time): Do not declare.
11745
11746         * src/misc.c (chdir_from_initial_wd): Remove.
11747         (deref_stat): New function.
11748         (struct wd): New struct.
11749         (wd, wds, wd_alloc): New variables.
11750         (chdir_arg, chdir_do): New function.
11751
11752         * src/compare.c (get_stat_data): Use deref_stat.
11753
11754         * src/common.h (name_expand): Remove.
11755
11756         * src/list.c (time): Declare if not defined.
11757         (base_64_digits): Moved here from create.c.
11758         (base64_map): Use UCHAR_MAX for size, not less-clear (unsigned char)
11759         -1.
11760         (read_and): Don't get time from header unless we need it now;
11761         as getting time can cause duplicate diagnostics if bogus.
11762         Remove "Hmm, " from diagnostic.
11763         Use "Skipping to next header" uniformly.
11764         (from_header): Renamed from from_chars.  All uses changed.
11765         Allow different forms for unportable 2's complement numbers.
11766         Don't check for extended forms when parsing checksums.
11767         Parse base-256 output.
11768         (gid_from_header): Renamed from gid_from_chars.  All uses changed.
11769         (major_from_header): Renamed from major_from_chars.  All uses changed.
11770         (minor_from_header): Renamed from minor_from_chars.  All uses changed.
11771         (mode_from_header): Renamed from mode_from_chars.  All uses changed.
11772         (off_from_header): Renamed from off_from_chars.  All uses changed.
11773         (size_from_header): Renamed from size_from_chars.  All uses changed.
11774         (time_from_header): Renamed from time_from_chars.  All uses changed.
11775         Warn about future timestamps.
11776         (uid_from_header): Renamed from uid_from_chars.  All uses changed.
11777         (uintmax_from_header): Renamed from uintmax_from_chars.
11778         All uses changed.
11779         (tartime): New function, incorporating isotime.
11780         (isotime): Delete.
11781         (print_header): Use tartime.
11782
11783         * src/create.c (to_chars): Fix typo in decl.
11784         Don't assign through char const *.
11785         Rename name_expand back to collect_and_sort_names.
11786
11787         * src/extract.c (<time.h>): No need to include.
11788         (time): No need to declare.
11789         (now): Remove variable.
11790         (extr_init): Don't initialize `now'.
11791         Increment same_permissions_option and same_owner_option if we_are_root
11792         is nonzero; this supports the new --no-same-owner option.
11793         (set_stat): Use start_time instead of `now'.
11794
11795         * src/create.c (struct link): Remove unused linkcount member.
11796         (base_64_digits): Move to list.c.
11797         (base_8_digits): Remove.
11798         (to_octal): New function, with some of old contents of to_base.
11799         (to_base): Remove.
11800         (to_base256): New function.
11801         (to_chars): Use base 256, not base 64, for huge values.
11802         (mode_to_chars): Don't use two's complement in GNU format or POSIX
11803         format.
11804         (dump_file): Interchange last two arguments. If TOP_LEVEL is negative,
11805         it means we have an incremental dump where we don't know whether this
11806         is a top-level call.
11807         Use deref_stat instead of statx / stat / lstat.
11808         Cast result of alloca.
11809         Check for dates if 0 < top_level, not if listed_incremental_option.
11810         Move multiple-link check after directory check.
11811         Do not dump avoided names.
11812         Dump hard links to symbolic names as links, not as separate
11813         symbolic links.
11814         start_header cannot return a null pointer, so don't test for it.
11815         Likewise for find_next_block.
11816
11817         * src/buffer.c, src/common.h (<human.h>): Include.
11818         (read_error): Read error is an error, not just a warning.
11819         (print_total_written): Also print human-readable byte count, and
11820         bytes/s.
11821         (open_archive, flush_write): Use start_time, not current time.
11822         (flush_read): Report about garbage bytes ignored at end of archive,
11823         but act on non-garbage bytes (instead of ignoring them).
11824         (new_volume): Use WARN for warnings.
11825
11826         * doc/Makefile.am:
11827         ($(srcdir)/tar.info): Add -I$(srcdir) so that subdir builds work.
11828
11829         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/fnmatch.m4.
11830
11831         * m4/Makefile.am (EXTRA_DIST): Add fnmatch.m4.
11832
11833         * lib/Makefile.am (noinst_HEADERS):
11834         Rename fnmatch.h to fnmatch.hin; add human.h.
11835         (libtar_a_SOURCES): Add human.c, xstrtoul.c.
11836         (INCLUDES): Remove -I.. -I$(srcdir) -- automake adds this for us.
11837
11838         * src/Makefile.am (rmt_LDADD, tar_LDADD): New macros.
11839
11840         * lib/fnmatch.c (strchrnul):
11841         Define to __strchrnul if _LIBC, to our own replacement otherwise.
11842         Do not define if !_LIBC and if it already exists.
11843         (internal_fnmatch): Use it.
11844
11845         * configure.in (tar_LDADD): New variable, used only when linking tar.
11846         (rmt_LDADD): Similarly, for rmt.
11847         (AC_FUNC_FNMATCH): Link fnnmatch.hin to fnmatch.h if we're using our
11848         fnmatch.c; otherwise, use the system fnmatch.h.
11849
11850         * doc/tar.texi: Add --no-same-owner, --no-same-permissions.
11851         Modernize sample backup script.
11852
11853         * THANKS: Martin Goik's email address has changed.
11854
11855         * m4/fnmatch.m4: New file.
11856
11857 1999-09-03  Paul Eggert  <eggert@twinsun.com>
11858
11859         * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
11860         Use EINVAL instead.
11861
11862 1999-08-29  Paul Eggert  <eggert@twinsun.com>
11863
11864         * lib/getdate.y (get_date):
11865         Rename outermost local `probe' to `quarter'.
11866         Rename latter local `tm' to probe_tm.
11867         From: Jim Meyering <meyering@ascend.com>
11868         Message-ID: <uryn1vafyyc.fsf@ixi.eng.ascend.com>
11869
11870 1999-08-28  Paul Eggert  <eggert@twinsun.com>
11871
11872         * lib/getdate.y (PC): New macro; use it when possible.
11873         (number): Handle `Nov 11 1996' example correctly.
11874         See Risks Digest 20.55 (1999-08-27)
11875         http://catless.ncl.ac.uk/Risks/20.55.html#subj18
11876
11877 1999-08-23  Paul Eggert  <eggert@twinsun.com>
11878
11879         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.11.
11880
11881         Remove minor cases of lint from many source files: this includes
11882         unnecessary casts, uses of NULL, etc.
11883
11884         * configure.in (AC_PROG_YACC): Remove.
11885         (YACC): Always use bison.
11886         (AC_STRUCT_TIMEZONE): Add.
11887         (AC_REPLACE_FUNCS): Add strcasecmp, strncasecmp.
11888
11889         * doc/tar.texi: --bzip2 is now -I.  Remove obsolete time zone info.
11890         Fix spelling.
11891
11892         * lib/Makefile.am (EXTRA_DIST): Add strcasecmp.c, strncasecmp.c.
11893         ($(srcdir)/getdate.c): Rename y.tab.c to getdate.c only if successful.
11894
11895         * lib/strcasecmp.c, lib/strncasecmp.c: New files.
11896
11897         * src/common.h (merge_sort): Remove decl; no longer exported.
11898
11899         * src/system.h (voidstar): Remove.
11900         (memcpy, memcmp): Cast args.
11901         ("xalloc.h"): Add include.
11902         (xmalloc, xrealloc): Remove decl.
11903
11904         * src/mangle.c (time): Do not declare if defined.
11905         (first_mangle, mangled_num): Remove.
11906
11907         * src/list.c (from_chars): Report out-of-range values more precisely.
11908         (off_from_chars): Do not allow negative offsets.
11909         (uid_from_chars): Allow negative uids.
11910
11911         * src/create.c (linklist): Now static.
11912         (to_chars): Fix wording of message to match from_chars.
11913
11914         * src/misc.c (merge_sort): Move to incremen.c.
11915         * src/incremen.c (merge_sort): Move here from misc.c; now static.
11916         It's too painful to make it both generic and portable.
11917         (read_directory_file): "timestamp" -> "time stamp" in messages.
11918
11919         * src/tar.c (long_options, usage, main): -y is now -I (for --bzip).
11920         (usage): Fix misspelling.
11921         (OPTION_STRING): -y is now -I.
11922         (decode_options): Use -1, not EOF, for getopt_long result.
11923         Fix typo when invoking xstrtoumax: look for LONGINT_OK, not LONG_MAX.
11924         Handle operands after any "--" argument.
11925         (main): Report any output errors.
11926
11927         * src/rmt.c (main): status is ssize_t, not long.
11928
11929         * src/names.c (name_gather): Handle trailing -C option correctly.
11930         (addname): use memcpy, not strncpy, to copy a string of known length.
11931         (name_match): Handle trailing -C option correctly.
11932         Propagate -C option to following files.
11933         (name_match, name_scan): Remove redundant matching code.
11934
11935         * src/buffer.c (open_archive): Use American spelling in diagnostic.
11936
11937         * lib/getdate.y: Major rewrite.  Add copyright notice.
11938         (<stdio.h>): Include only if testing.
11939         (ISUPPER): Remove.
11940         (ISLOWER): New macro.
11941         (<string.h>): Include if HAVE_STRING_H, not USG.
11942         (bcopy): Remove.
11943         (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
11944         bison.
11945         (EPOCH_YEAR): Renamed from EPOCH.
11946         (table): Renamed from TABLE.
11947         (meridian): Now an anonymous enum.
11948         (struct parser_control): New type.
11949         (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
11950         (yyInput, ..., yyRelYear): Migrated into struct parser_control.
11951         (%pure_parser): Added, so that the parser is pure.
11952         (%union): Removed; the type is now just plain int.
11953         All %type directives removed.
11954         (tLOCAL_ZONE): New %token.
11955         (month_day_table): Renamed from MonthDayTable.
11956         (gmtime, localtime, mktime, time): Declare only if not defined.
11957         (meridian_table): New table.
11958         (dst_table): New table.
11959         (units_table): renamed from UnitsTable.
11960         (relative_time_table): Renamed from OtherTable.
11961         (time_zone_table): Renamed from TimezoneTable.  Modernized.
11962         (military_table): Renamed from MilitaryTable.
11963         (to_hour): Renamed from ToHour.
11964         (to_year): Renamed from ToYear.
11965         (lookup_zone): New function.
11966         (LookupWord): Renamed from lookup_word.  Use lookup_zone for time
11967         zones.
11968         (yylex): Now reentrant.  All callers changed.
11969         (get_date): Add support for local time zone abbreviations.
11970         Make it reentrant.
11971
11972 1999-08-20  Paul Eggert  <eggert@twinsun.com>
11973
11974         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.10.
11975
11976         * src/create.c (to_chars): Generate GNU base-64 representation
11977         if we are generating an old or new GNU format tar file for a
11978         number that can't be represented with the POSIX format.
11979
11980         * configure.in (AC_CHECK_FUNCS): Add fchdir.
11981         (AM_FUNC_GETLINE): Add.
11982         (LIBOBJS): Add getline.o to workaround comment.
11983         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/getline.m4.
11984         * m4/Makefile.am (EXTRA_DIST): Add getline.m4.
11985         * lib/Makefile.am (noinst_HEADERS): Add getline.h, save-cwd.h.
11986         (libtar_a_SOURCES): Add save-cwd.c, xgetcwd.c.
11987         * lib/getline.c, lib/getline.h, lib/save-cwd.c,
11988         lib/save-cwd.h, m4/getline.m4: New files.
11989
11990         * src/misc.c (<save-cwd.h>): Include.
11991         (chdir_from_initial_wd): New function.
11992
11993         * src/names.c (name_next): Use chdir_from_initial_wd, not chdir.
11994         (name_gather): Handle `-C x -C y' correctly.
11995         Do not rely on addname to handle -C.
11996         (addname): New CHANGE_DIR parameter.  All callers changed.
11997         Remove ugly calls to getcwd; no longer needed.
11998         (name_match, name_from_list): Use chdir_from_initial_wd, not chdir.
11999
12000         * src/incremen.c (listed_incremental_stream): New var.
12001         (read_directory_file): Remove arbitrary limits on file name length.
12002         Do not attempt to get the working directory; we can bypass this
12003         on fchdir hosts.  Open the listed_incremental_option file for both
12004         read and write instead of opening it twice.  Check for I/O errors
12005         when doing I/O to this file.  Check for invalid data in the file,
12006         and report line numbers of invalid data.
12007         (write_dir_file): Likewise.
12008         (collect_and_sort_names): Use chdir_from_initial_wd, not chdir.
12009         Do not invoke write_dir_file; that's our caller's responsibility.
12010
12011         * src/list.c (max): New macro.
12012         (isotime): Now takes time_t, not time_t *.  Report the decimal values
12013         of times that can't be broken down.
12014         (print_header): Don't assume that major and minor device numbers can
12015         fit into uintmax_t.
12016
12017         * src/common.h (struct name): change_dir is now char const *.
12018         (write_directory_file): Remove unused decl.
12019         (STRINGIFY_BIGINT): Assume b always points to UINTMAX_STRSIZE_BOUND
12020         chars; the old `sizeof (b)' broke when b was a pointer not an array.
12021         (chdir_from_initial_wd): New decl.
12022         (addname): New 2nd arg.
12023
12024         * THANKS: Torsten Lull -> Catrin Urbanneck
12025
12026 1999-08-18  Paul Eggert  <eggert@twinsun.com>
12027
12028         * configure.in (HAVE_GETHOSTENT, HAVE_SETSOCKOPT):
12029         Don't depend on ac_cv_func variables.
12030         From Albert Chin-A-Young <china@thewrittenword.com>.
12031
12032 1999-08-18  Paul Eggert  <eggert@twinsun.com>
12033
12034         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.9
12035
12036         * m4/signedchar.m4: New file.
12037         * configure.in (pe_AC_TYPE_SIGNED_CHAR): Add.
12038         * src/system.h (signed_char): New macro.
12039         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/signedchar.m4.
12040         * m4/Makefile.am (EXTRA_DIST): Add signedchar.m4.
12041
12042         * src/create.c (write_eot): Write at least two zero blocks.
12043
12044         * src/extract.c (extract_archive): Fix sparse array bug:
12045         we did not find end of array correctly.
12046
12047         * src/compare.c: (fill_in_sparse_array, diff_sparse_files):
12048         Don't assume find_next_block yields nonnull.
12049         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
12050         * src/list.c (skip_extended_headers): Likewise.
12051
12052         * src/list.c (read_and, list_archive): Simplify code.
12053         (read_header): Fix computation of signed checksums on machines where
12054         char is unsigned.
12055         Do not consider a block to be zero unless all its bytes are zero,
12056         even the checksum bytes.  Do not attempt to parse the checksum of
12057         a zero block.  Fix memory leak with long names and links.
12058         (from_chars): Accommodate a buggy tar that outputs leading NUL
12059         if the previous field overflows.
12060
12061         * src/misc.c (quote_copy_string): Generate \177 for '\177', not
12062         \?, for portability to non-ASCII hosts.
12063
12064 1999-08-16  Paul Eggert  <eggert@twinsun.com>
12065
12066         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.8.
12067
12068         * src/extract.c (make_directories): Do not chown intermediate
12069         directories, even if we are root.
12070
12071         * src/list.c (read_header): Fix bugs when interpreting
12072         POSIX-compliant headers that do not contain null bytes in the
12073         header or link names.
12074
12075 1999-08-14  Paul Eggert  <eggert@twinsun.com>
12076
12077         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.7.
12078
12079         * configure.in (AC_CHECK_HEADERS): Remove sys/wait.h.
12080         (AC_HEADER_SYS_WAIT): Add.
12081         (AC_REPLACE_FUNCS): Add waitpid.
12082         (tar_cv_header_union_wait, HAVE_UNION_WAIT): Remove.
12083         * lib/waitpid.c: New file.
12084         * lib/Makefile.am (EXTRA_DIST): Add waitpid.c.
12085         * src/system.h (WCOREDUMP): Remove; no longer used.
12086         (WIFSTOPPED): Likewise.
12087         (WEXITSTATUS, WIFSIGNALED): Default to Solaris 7 versions.
12088         * src/buffer.c (child_open_for_compress): Undo previous change.
12089         (close_archive): Use waitpid, POSIX-style, instead of old BSD style.
12090         (new_volume): Likewise.
12091
12092         * src/buffer.c, src/extract.c, src/incremen.c (time):
12093         Don't declare if defined.
12094         * src/extract.c (extr_init): Remove unneeded cast around 0 arg to time.
12095         * src/incremen.c (read_directory_file):
12096         Invoke `time' the same way everyone else does.
12097         Check validity of --listed-incremental file contents a bit better.
12098         Do not worry about --after-date-option; tar.c now checks this.
12099         * src/list.c (isotime): Report ??? if localtime returns null.
12100         Don't assume years fit into four digits.
12101         Don't append trailing newline.
12102         (print_header): Report ??? if localtime returns null;
12103         Don't assume years fit into four digits.
12104
12105         * src/compare.c (diff_archive): Do not fall back on absolute name
12106         when --absolute-names is not specified.
12107
12108         * src/create.c (start_header):
12109         Include text of ignored filesystem prefix in warning.
12110         (create_archive): Check for excluded names when doing incremental
12111         pass through directory.
12112         (dump_file): Do not dump old files explicitly given on command line
12113         when using --listed-incremental.  Do not strip ./ prefix from names.
12114
12115         * src/tar.c: -g now implies after_date_option = 1.
12116         -g and -N are now incompatible options.
12117
12118         * doc/tar.texi: Explain --exclude better.  Don't strip leading `./'.
12119
12120 1999-08-11  Jeff Dairiki  <dairiki@dairiki.org>
12121
12122         * src/list.c (read_header): Don't parse OLDGNU_FORMAT
12123         incremental headers as POSIX prefixes.
12124
12125 1999-08-11  Paul Eggert  <eggert@twinsun.com>
12126
12127         * NEWS, configure.in: Version 1.13.6.
12128
12129         * configure.in (ALL_LINGUAS): Add pt_BR.
12130         * po/pt_BR.po: New file.
12131
12132         * doc/Makefile.am ($(srcdir)/tar.info, $(srcdir)/header.texi):
12133         Renamed from tar.info and header.texi; adjust actions so that
12134         they work in other directories.
12135
12136         * doc/tar.texi: Add -y and --bzip2.
12137         Patterns containing / now exclude only file names whose prefix match.
12138
12139         * lib/exclude.h (excluded_filename): New option parameter.
12140         (add_exclude_file): New ADD_FUNC parameter.
12141         (excluded_pathname): Remove decl.
12142         * lib/exclude.c (_GNU_SOURCE):
12143         Remove; no longer needed since we don't use FNM_ macros.
12144         (excluded_filename): Renamed from excluded_filename_opts.
12145         (excluded_filename, excluded_pathname): Remove.
12146         (add_exclude_file): New ADD_FUNC parameter.
12147
12148         * po/POTFILES.in: Add lib/quotearg.c.
12149
12150         * src/buffer.c (_GNU_SOURCE): Define.
12151         (<fnmatch.h>): Include unconditionally.
12152         (child_open_for_compress): Dup after closing, to avoid possible file
12153         descriptor exhaustion.
12154         (flush_write): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
12155         (flush_read): Likewise.
12156
12157         * src/common.h (LG_8, LG_64): New macros.
12158         (excluded_with_slash, excluded_without_slash): New vars.
12159         (excluded): Remove.
12160         (base_64_digits): New decl.
12161         (gid_to_chars, major_to_chars, minor_to_chars, mode_to_chars,
12162         off_to_chars, size_to_chars, time_to_chars, uid_to_chars,
12163         uintmax_to_chars,
12164         GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS,
12165         OFF_TO_CHARS, SIZE_TO_CHARS, TIME_TO_CHARS, UID_TO_CHARS,
12166         UINTMAX_TO_CHARS):
12167         Renamed from gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
12168         off_to_oct, size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
12169         GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, OFF_TO_OCT,
12170         SIZE_TO_OCT, TIME_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT,
12171         respectively.  All definitions and uses changed.
12172         (excluded_name): New decl.
12173
12174         * src/compare.c (diff_archive):
12175         Open files with O_NONBLOCK instead of O_NDELAY.
12176
12177         * src/create.c (base_64_digits): New constant.
12178         (base_8_digits): New macro.
12179         (MAX_VAL_WITH_DIGITS): New macro.
12180         (to_base): First half of old to_oct.  Support base 64 too.
12181         (to_chars): Other half of old to_oct, for 64-bit support.
12182         (GID_NOBODY, UID_NOBODY): Don't define if the headers don't.
12183         (gid_substitute, uid_substitute): Look up names dynamically if
12184         GID_NOBODY and UID_NOBODY aren't defined; use -2 if all else fails.
12185         (mode_to_chars): Renamed from mode_to_oct.
12186         Support negative values in all the _to_chars functions.
12187         (start_header): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
12188         Abort if archive format is DEFAULT_FORMAT when it shouldn't be.
12189         (dump_file): Inspect entire pathname, not just new file name
12190         component, when deciding whether to exclude it.
12191
12192         * src/extract.c (extract_archive):
12193         Open files with O_NONBLOCK instead of O_NDELAY.
12194
12195         * src/incremen.c (get_directory_contents):
12196         Inspect entire pathname, not just new file name
12197         component, when deciding whether to exclude it.
12198
12199         * src/list.c (<fnmatch.h>): Do not include.
12200         (from_chars): Renamed from from_oct.  New parameter specifying
12201         the negative of the minimum allowed value.  Support negative
12202         and base-64 values.
12203         (base64_map): New var.
12204         (base64_init): New function.
12205         (print_header): Output numeric uids and gids if numeric_owner_option.
12206
12207         * src/misc.c (quote_copy_string): Use LG_8 instead of constants.
12208
12209         * src/names.c (_GNU_SOURCE): Define.
12210         (<fnmatch.h>): Include unconditionally.
12211         (excluded_name): New function, taking over duties of excluded_pathname.
12212         All uses changed.
12213
12214         * src/rmt.c (decode_oflag): New function.
12215         (main): Use it to support symbolic open flags.
12216
12217         * src/rtapelib.c (encode_oflag): New function.
12218         (rmt_open__): Do not allow newlines in the path.
12219         Propagate errno correctly.
12220         Decode symbolic open flags, if present.
12221
12222         * src/system.h (FILESYSTEM_PREFIX_LEN, ISSLASH, O_ACCMODE, O_NONBLOCK):
12223         New macros.
12224
12225         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
12226         New -y or --bzip2 option.
12227         (add_filtered_exclude): New function.
12228         (decode_options): Put excluded patterns with / into
12229         excluded_with_slash, and without / into excluded_without_slash.
12230         Compare newer_mtime_option to its new initial value
12231         TYPE_MINIMUM (time_t) when deciding whether more than one
12232         threshold date was specified.
12233
12234 1999-07-20  Paul Eggert  <eggert@twinsun.com>
12235
12236         * NEWS, configure.in: Version 1.13.5.
12237
12238         * src/common.h (FATAL_ERROR): Invoke apply_delayed_set_stat
12239         before exiting.
12240         * src/buffer.c (new_volume): Likewise.
12241         * src/incremen.c (read_directory_file): Likewise.
12242         * src/tar.c (decode_options):
12243         ERROR ((TAREXIT_FAILURE, ... -> FATAL_ERROR ((0,
12244         for consistency.
12245
12246         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.4.
12247         * configure.in (AC_CHECK_FUNCS): Add lstat, readlink, symlink.
12248
12249         * src/system.h (lstat): Define only if !HAVE_LSTAT && !defined lstat.
12250         (S_ISMPB, S_ISMPC, S_ISNWK): Remove unused macros.
12251         (S_ISBLK, S_ISCHR, S_ISCTG, S_ISFIFO, S_ISLNK, S_ISSOCK):
12252         Define to 0 if the corresponding S_IF* macro is not defined.
12253         (mkfifo): Do not define if already defined, or if S_IFIFO
12254         is not defined.
12255
12256         * src/compare.c (diff_archive): Use HAVE_READLINK, not
12257         S_ISLNK, to determine whether to invoke readlink.
12258         * src/create.c (dump_file): Likewise.
12259
12260         * src/extract.c (set_mode):
12261         Do not chmod unless we are root or the -p option was given;
12262         this matches historical practice.
12263         (unlink_destination): New function, which checks for unlink failures.
12264         (maybe_recoverable): Stay quiet if -U.
12265         (extract_archive): Use O_EXCL if unlink_first_option.
12266         Report unlink failures.
12267         Use HAVE_SYMLINK, not S_ISLNK, to determine whether symlink exists.
12268         Use HAVE_MKFIFO || defined mkfifo, not S_ISFIFO, to determine whether
12269         mkfifo exists.
12270
12271         * src/incremen.c (get_directory_contents): Depend on
12272         S_ISHIDDEN, not AIX, to determine whether to invoke S_ISHIDDEN.
12273
12274         * src/list.c: Remove S_IS* ifdefs.
12275         * src/misc.c (maybe_backup_file): Likewise.
12276
12277         * src/misc.c (maybe_backup_file):
12278         "Virtual memory exhausted" -> "Memory exhausted",
12279         to conform to the other places this message is issued.
12280
12281         * src/mangle.c (extract_mangle):
12282         Replace #ifdef S_ISLNK with #ifdef HAVE_SYMLINK.
12283
12284         * src/rtapelib.c (rmt_open__):
12285         Remove typo that caused us to omit the first char
12286         of the basename.
12287
12288 1999-07-16  Paul Eggert  <eggert@twinsun.com>
12289
12290         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.13.3.
12291
12292         * doc/tar.texi: A path name is excluded if any of its file name
12293         components matches an excluded pattern, even if the path name was
12294         specified on the command line.
12295         * src/create.c (create_archive): Likewise.
12296         * src/list.c (read_and): Likewise.
12297         * src/update.c (update_archive): Likewise.
12298         * lib/exclude.h (excluded_pathname): New decl.
12299         * lib/exclude.c (_GNU_SOURCE): Define.
12300         (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros.
12301         (excluded_filename_opts): New function.
12302         (excluded_pathname): New function.
12303
12304         * lib/Makefile.am (EXTRA_DIST):
12305         xstrtol.c moved here from libtar_a_SOURCES.
12306         (libtar_a_SOURCES): Move xstrtol.c to EXTRA_DIST.
12307         Remove xstrtoul.c; no longer needed.
12308         * lib/xstrtol.c: Remove.
12309
12310         * src/tar.c (decode_options):
12311         Set newer_time_option to TYPE_MINIMUM, so that
12312         negative timestamps are handled correctly.
12313         Replace invocations of xstrtol and xstrtoul with xstrtoumax, for
12314         uniformity (and so that we don't need to have the other fns).
12315         (main): Remove call to init_total_written; no longer needed.
12316
12317         * configure.in (AC_CHECK_SIZEOF): Remove no-longer-needed
12318         checks for unsigned long and long long.
12319         * src/arith.c: Remove.
12320         * src/Makefile.am (tar_SOURCES): Remove arith.c.
12321         * po/POTFILES.in: Remove src/arith.c.
12322         * src/arith.h: Use double, to simplify configuration gotchas.
12323         (tarlong): Now double.
12324         (TARLONG_FORMAT): New macro.
12325         (BITS_PER_BYTE, BITS_PER_TARLONG, SUPERDIGIT, BITS_PER_SUPERDIGIT,
12326         LONGS_PER_TARLONG, SIZEOF_TARLONG, struct tarlong,
12327         zerop_tarlong_helper, lessp_tarlong_helper, clear_tarlong_helper,
12328         add_to_tarlong_helper, mult_tarlong_helper, print_tarlong_helper,
12329         zerop_tarlong, lessp_tarlong, clear_tarlong, add_to_tarlong,
12330         mult_tarlong, print_tarlong): Remove.  All callers replaced with
12331         arithmetic ops.
12332
12333         * src/common.h (init_total_written): Remove decl.
12334
12335         * src/buffer.c (total_written):
12336         Remove; replaced with prev_written + bytes_written.
12337         (prev_written): New var.
12338         (init_total_written): Remove.
12339         (print_total_written): Use TARLONG_FORMAT instead of print_tarlong.
12340
12341         * m4/ulonglong.m4 (jm_AC_TYPE_UNSIGNED_LONG_LONG):
12342         Make sure that we can shift, multiply
12343         and divide unsigned long long values; Ultrix cc can't do it.
12344
12345         * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned long.
12346         Check for any unknown bits, not just unknown bits left of the leftmost
12347         known bit.
12348
12349         * lib/quotearg.c (quotearg_buffer):
12350         Don't quote spaces if C quoting style.
12351         * src/list.c (from_oct):
12352         Use C quoting style for error; omit trailing NULs.
12353
12354 1999-07-14  Paul Eggert  <eggert@twinsun.com>
12355
12356         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.2.
12357
12358         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): Check whether
12359         <inttypes.h> defines strtoumax as a macro (and not as a function).
12360         HP-UX 10.20 does this.
12361
12362         * src/tar.c (usage): tar-bugs@gnu.org -> bug-tar@gnu.org
12363         * PORTS, README, TODO, doc/tar.texi: Likewise.
12364
12365 1999-07-12  Paul Eggert  <eggert@twinsun.com>
12366
12367         * configure.in (AM_INIT_AUTOMAKE): Version 1.13.1.
12368         (LIBOBJS): Add mktime.o to automake 1.4 bug workaround.
12369
12370         * src/list.c (decode_header):
12371         Do not assume that S_IFBLK and S_IFCHR are defined.
12372
12373         * src/create.c (start_header): Do not assume S_IFMT is defined.
12374         (dump_file): Remove unnecessary check for screwy apollo lossage.
12375         Do not assume S_IFBLK and S_IFCHR are defined.
12376
12377         * src/extract.c (extract_archive):
12378         Test whether S_IFCHR and S_IFBLK are nonzero,
12379         not whether they are defined, for consistency with other tests.
12380
12381         * src/buffer.c (is_regular_file):
12382         Don't succeed on files that we can't access due to
12383         permissions problems.
12384         (open_archive): Fix wording on fatal error message.
12385         Don't bother to stat /dev/null if the archive is not a character
12386         special device.
12387
12388         * src/compare.c (process_rawdata, diff_sparse_files, diff_archive):
12389         Report an error, not a warning, for I/O errors.
12390         (process_rawdata, process_dumpdir, diff_sparse_files):
12391         Change ungrammatical "Data differs" to "Contents differ".
12392         (get_stat_data): Find hidden files on AIX.
12393         Accept file name as argument; all uses changed.
12394         (get_stat_data, diff_archive): Use system error message for
12395         nonexistent files rather than rolling our own.
12396         (diff_archive): Unknown file types are errors, not warnings.
12397         Normalize spelling of message to "File type differs".
12398         Use get_stat_data to get link status, for consistency.
12399         Do not inspect st_rdev for fifos.
12400         Do not assume st_mode values contain only file types and mode bits.
12401         Check for mode changes and device number changes separately.
12402
12403         * src/update.c (append_file):
12404         Open the file before statting it, to avoid a race.
12405         Complain about file shrinkage only when we reach EOF.
12406
12407 1999-07-08  Paul Eggert  <eggert@twinsun.com>
12408
12409         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13 released.
12410
12411         * configure.in (AC_EXEEXT): Add.
12412
12413         * lib/Makefile.am (noinst_HEADERS):
12414         Add basename.h, exclude.h.  Remove full-write.h.
12415         (libtar_a_SOURCES): Add exclude.c.
12416
12417         * lib/basename.h, lib/exclude.c, lib/exclude.h, lib/safe-read.h:
12418         New files.
12419         * lib/full-write.c: Include safe-read.h instead of full-write.h.
12420         * lib/safe-read.h (safe_read): New decl.
12421         * src/rmt.c: Include safe-read.h.
12422         * src/rtapelib.c: Include basename.h, save-read.h.
12423         (rmt_open__): Use base_name to compute base name.
12424
12425         * src/common.h:
12426         Include basename.h, exclude.h; don't include full-write.h.
12427         (exclude_option): Remove decl.
12428         (excluded): New decl.
12429         (add_exclude, add_exclude_file, check_exclude): Remove decls.
12430
12431         * src/list.c (read_and):
12432         Use excluded_filename instead of check_exclude.
12433         Check base name of incoming file name, not entire file name, when
12434         deciding whether to exclude it.
12435
12436         * src/create.c (finish_sparse_file):
12437         Use excluded_filename instead of check_exclude.
12438         Don't bother to stat excluded file names.
12439         * src/incremen.c (get_directory_contents): Likewise.
12440
12441         * src/names.c (exclude_pool, exclude_pool_size,
12442         allocated_exclude_pool_size, simple_exclude_array,
12443         simple_excludes, allocated_simple_excludes,
12444         pattern_exclude_array, pattern_excludes,
12445         allocated_pattern_excludes, add_exclude, add_exclude_file,
12446         check_exclude):
12447         Remove; now done in ../lib/exclude.c.
12448
12449         * src/tar.c (decode_options): Initialize `excluded'.
12450         Use new add_exclude_file and add_exclude functions.
12451
12452 1999-07-05  Paul Eggert  <eggert@twinsun.com>
12453
12454         * m4/gettext.m4: Use changequote rather than [[ ]].
12455
12456         * lib/safe-read.c: Renamed from lib/full-read.c.
12457         (safe_read): Renamed from full_read.  All uses changed.
12458         * lib/safe-read.h, lib/full-write.h: New files.
12459         * lib/Makefile.am (noinst_HEADERS): Add full-write.h, safe-read.h.
12460         (libtar_a_SOURCES): Rename full-read.c to safe-read.c.
12461         * lib/full-write.c: Include full-write.h.
12462         * src/common.h: Include full-write.h, safe-read.h.
12463         * src/system.h: (full_read, full_write): Remove decls.
12464
12465         * src/Makefile.am (datadir): New var; needed for Solaris gettext.
12466
12467         * src/system.h (bindtextdomain, textdomain): undef before
12468         defining, to avoid preprocessor warnings with --disable-nls
12469         on hosts whose locale.h includes libintl.h.
12470
12471         * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
12472         expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
12473         (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
12474         the above decl.
12475
12476 1999-07-02  Paul Eggert  <eggert@twinsun.com>
12477
12478         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/mktime.m4.
12479         * m4/mktime.m4: New file.
12480         * m4/Makefile.am.in, m4/README: Remove these files.
12481         * m4/Makefile.am (EXTRA_DIST): Add mktime.m4;
12482         remove README, Makefile.am.in.
12483         (Makefile.am): Remove rule; it didn't work in BSD/OS 4.0.
12484         * m4/jm-mktime.m4 (jm_FUNC_MKTIME): Invoke AC_FUNC_MKTIME,
12485         not AM_FUNC_MKTIME.
12486
12487         * src/tar.c: Include signal.h.
12488         (SIGCHLD): Define to SIGCLD if SIGCLD is defined but SIGCHLD is not.
12489         (main): Ensure SIGCHLD is not ignored.
12490
12491         (BACKUP_OPTION, DELETE_OPTION, EXCLUDE_OPTION, GROUP_OPTION,
12492         MODE_OPTION, NEWER_MTIME_OPTION, NO_RECURSE_OPTION, NULL_OPTION,
12493         OWNER_OPTION, POSIX_OPTION, PRESERVE_OPTION, RECORD_SIZE_OPTION,
12494         RSH_COMMAND_OPTION, SUFFIX_OPTION, USE_COMPRESS_PROGRAM_OPTION,
12495         VOLNO_FILE_OPTION, OBSOLETE_ABSOLUTE_NAMES,
12496         OBSOLETE_BLOCK_COMPRESS, OBSOLETE_BLOCKING_FACTOR,
12497         OBSOLETE_BLOCK_NUMBER, OBSOLETE_READ_FULL_RECORDS, OBSOLETE_TOUCH,
12498         OBSOLETE_VERSION_CONTROL): Make sure they can't be valid chars, so
12499         they don't overlap with char codes.  Use an enum instead of a lot
12500         of #defines.
12501
12502         * src/system.h (ISASCII): Remove.
12503         (CTYPE_DOMAIN, ISDIGIT, ISODIGIT, ISPRINT, ISSPACE, S_ISUID,
12504         S_ISGID, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP,
12505         S_IROTH, S_IWOTH, S_IXOTH, MODE_WXUSR, MODE_R, MODE_RW,
12506         MODE_RWX, MODE_ALL, SEEK_SET, SEEK_CUR, SEEK_END, CHAR_MAX,
12507         LONG_MAX): New macros.
12508
12509         * src/incremen.c (ISDIGIT, ISSPACE): Remove; now in system.h.
12510         (read_directory_file): Cast ISSPACE arg to unsigned char.
12511         * src/misc.c (ISPRINT): Remove; now in system.h.
12512         (remove_any_file): Add brackets to pacify gcc -Wall.
12513         * src/list.c: Don't include <ctype.h>; system.h already does this.
12514         (ISODIGIT, ISSPACE): Remove; now in system.h.
12515         (decode_header): No need to AND mode with 07777; MODE_FROM_OCT
12516         does this now.
12517         (from_oct): Cast ISSPACE arg to unsigned char.
12518
12519         * src/create.c (mode_to_oct): Translate modes from internal to
12520         external form.
12521         * src/list.c (mode_from_oct): Translate modes from external to
12522         internal form.  Do not complain about unrecognized mode bits.
12523         * src/common.h (TSUID, TSGID, TSVTX, TUREAD, TUWRITE, TUEXEC,
12524         TGREAD, TGWRITE, TGEXEC, TOREAD, TOWRITE, TOEXEC): Remove undefs.
12525
12526         * src/extract.c: (extr_init, make_directories, extract_archive):
12527         Do not assume mode bits have traditional Unix values.
12528         * src/list.c (decode_mode): Likewise.
12529         * src/create.c (start_header, dump_file): Likewise.
12530         * src/buffer.c (child_open_for_compress,
12531         child_open_for_uncompress, open_archive, (close_archive): Likewise.
12532         * src/compare.c (diff_archive): Likewise.
12533
12534         * src/extract.c (set_mode): Use %04 not %0.4 format.
12535         (extract_sparse_file): Do not use data_block uninitialized.
12536         Check for lseek failures.
12537
12538         * src/rtapelib.c (rmt_lseek__):
12539         Convert lseek whence values to portable integers on the wire.
12540         * src/rmt.c (main): Likewise.  Check for whence values out of range.
12541
12542         * src/create.c (finish_sparse_file): Use lseek whence macros
12543         instead of integers.
12544         * src/buffer.c (backspace_output): Likewise.
12545         * src/compare.c (diff_archive, verify_volume): Likewise.
12546         * src/delete.c (move_archive): Likewise.
12547         * src/extract.c (extract_sparse_file): Likewise.
12548
12549         * src/create.c (dump_file): Do not invoke finish_sparse_file
12550         on a negative file descriptor.
12551
12552         * src/buffer.c: Add braces to pacify gcc -Wall.
12553
12554         * src/compare.c (diff_sparse_files): Report lseek errors.
12555
12556         * configure.in (ALL_LINGUAS): Add cs, es, ru.
12557
12558         * PORTS, TODO: gnu.ai.mit.edu -> gnu.org
12559
12560         * src/arith.c, src/buffer.c (new_volume): Don't put ^G in
12561         message to be internationalized; \a doesn't work with msgfmt.
12562
12563         * src/tar.c (long_options, main, usage, OPTION_STRING):
12564         Remove -E or --ending-file.
12565         * src/list.c (read_and): Likewise.
12566         * src/common.h (ending_file_option): Likewise.
12567         * src/buffer.c (close_archive): Likewise.
12568
12569         * tests/after: Don't run two commands together in a pipeline,
12570         as some old shells mishandle pipeline exit status.
12571
12572 1999-06-28  Paul Eggert  <eggert@twinsun.com>
12573
12574         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64015.
12575         * NEWS: Describe changes since 1.12.
12576         * README: Update bug reporting address; move paxutils ref to NEWS.
12577
12578         Handle EINTR correctly.
12579         * lib/Makefile.am (libtar_a_SOURCES): Add full-read.c, full-write.c.
12580         * lib/full-read.c, lib/full-write.c: New files.
12581         * src/buffer.c (child_open_for_compress, child_open_for_uncompress):
12582         Prefer full_read to read and full_write to write.
12583         * src/compare.c (process_rawdata, diff_sparse_files): Likewise.
12584         * src/create.c (deal_with_sparse, finish_sparse_file, dump_file):
12585         Likewise.
12586         * src/extract.c (extract_sparse_file): Likewise.
12587         * src/rmt.c (get_string, main, report_error_message,
12588         report_numbered_error): Likewise.
12589         * src/rmt.h (rmtread, rmtwrite): Likewise.
12590         * src/rtapelib.c (do_command, get_status_string, rmt_read__,
12591         rmt_write__, rmt_ioctl__): Likewise.
12592         * src/update.c (append_file): Likewise.
12593         * src/system.h (full_read, full_write): New decls.
12594
12595         * po/POTFILES.in: Add lib/argmatch.c, lib/error.c lib/getopt.c,
12596         lib/xmalloc.c, src/arith.c, src/misc.c.
12597
12598         * src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
12599         New macros.  All uses of STDIN and STDOUT changed.
12600         * src/rmt.c (prepare_record_buffer, main): Use STDIN_FILENO
12601         instead of 0 and STDOUT_FILENO instead of 1.
12602         * src/rtapelib.c (_rmt_rexec): Use STDIN_FILENO and STDOUT_FILENO
12603         instead of fileno (stdin) and fileno (stdout) or 0 and 1.
12604
12605         * src/rmt.c (private_strerror): Avoid const.  Translate results.
12606
12607         * tests/Makefile.am (TESTS): Remove incremen.sh; it doesn't work
12608         in the presence of NFS clock skew.
12609
12610 1999-06-25  Paul Eggert  <eggert@twinsun.com>
12611
12612         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64014.
12613
12614         * src/buffer.c (write_archive_buffer): New function.
12615         (child_open_for_compress, flush_write, flush_read): Use it to write
12616         buffers.
12617         (open_archive): Report error if fstat of archive fails.
12618         Improve efficiency of check for /dev/null.
12619         Also, fix some corner cases with remote archives and /dev/null checking.
12620         (close_archive): Test for input fifo only if not remote.
12621         Truncate output archive only if it's not remote.
12622
12623         * src/misc.c (remove_any_file):
12624         Don't terminate if you see . or ..; just skip them.
12625
12626 1999-06-18  Paul Eggert  <eggert@twinsun.com>
12627
12628         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64013.
12629
12630         Output sizes using a format that's more compatible with
12631         traditional tar (and with GNU Emacs).
12632         * src/common.h (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT,
12633         MODE_TO_OCT, SIZE_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT):
12634         Don't subtract 1 from size.
12635         * src/create.c (to_oct): Prepend leading zeros, not spaces.
12636         Output a trailing NUL unless the value won't fit without it.
12637         (finish_header): No need to append NUL to chksum, now that
12638         to_oct is doing it.
12639
12640 1999-06-16  Paul Eggert  <eggert@twinsun.com>
12641
12642         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64012.
12643
12644         * src/Makefile.am (LDADD): Link libtar.a after @INTLLIBS@, since
12645         @INTLLIBS@ might invoke rpl_realloc.
12646
12647         * src/tar.c (backup_type): Remove decl; backupfile.h now has it.
12648         (intconv): Remove; use xstrto* fns instead.
12649         ("xstrtol.h"): Include.
12650         (check_decimal): Remove.
12651         (long_options, usage, OPTION_STRING, decode_options):
12652         Remove -y, --bzip2, --unbzip2.
12653         (decode_options): Use xget_version instead of get_version.
12654         Check for overflow with -b and -L and RECORD_SIZE_OPTION.
12655         Replace invocations of check_decimal  with xstrtoumax.
12656
12657         * tests/preset.in (echo_n, echo_c): Remove.
12658
12659         * tests/after: Don't rely on $echo_c and $echo_n.
12660
12661         * lib/addext.c, lib/dirname.c, lib/lchown.c, lib/lchown.h,
12662         lib/malloc.c, lib/mktime.c, lib/realloc.c, lib/strtol.c, lib/strtoul.c,
12663         lib/strtoull.c, lib/strtoumax.c, lib/utime.c, lib/xstrtol.c,
12664         lib/xstrtol.h, lib/xstrtoul.c, lib/xstrtoumax.c,
12665         m4/Makefile.am.in, m4/README, m4/ccstdc.m4, m4/d-ino.m4,
12666         m4/gettext.m4, m4/inttypes_h.m4, m4/isc-posix.m4,
12667         m4/jm-mktime.m4, m4/largefile.m4, m4/lcmessage.m4,
12668         m4/malloc.m4, m4/progtest.m4, m4/realloc.m4, m4/uintmax_t.m4,
12669         m4/ulonglong.m4, m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4,
12670         m4/xstrtoumax.m4: New files.
12671
12672         * configure.in(fp_PROG_ECHO): Remove; no longer needed.
12673         (AC_SYS_LARGEFILE): Renamed from AC_LFS.
12674         (jm_AC_HEADER_INTTYPES_H): Replaces inline code.
12675         (jm_STRUCT_DIRENT_D_INO, jm_AC_TYPE_UINTMAX_T, jm_AC_PREREQ_XSTRTOUMAX): Add.
12676         (AC_CHECK_FUNCS): Remove lchown.
12677         (AC_REPLACE_FUNCS): Remove basename, dirname.
12678         Add lchown, strtol, strtoul.
12679         (jm_FUNC_MKTIME): Add.
12680         (LIBOBJS): Replace .o with $U.o, so that the .o files in LIBOBJS
12681         are also built via the ANSI2KNR-filtering rules.
12682         Use a no-op line to work around bug in automake 1.4 with malloc and
12683         realloc.
12684         (AC_OUTPUT): Add m4/Makefile.
12685
12686         * lib/Makefile.am (EXTRA_DIST):
12687         Add lchown.c, malloc.c, mktime.c, realloc.c,
12688         strtol.c, strtoul.c, strtoull.c, strtoumax.c, utime.c.
12689         (noinst_HEADERS): Add lchown.h, modechange.h, xstrtol.h.
12690         (libtar_a_SOURCES): Add addext.c, basename.c, xstrtol.c,
12691         xstrtoul.c, xstrtoumax.c.  Remove getversion.c.
12692         ($(srcdir)/getdate.c:): Remove `expect conflicts' line.
12693
12694         * src/system.h (uintmax_t): Don't declare; configure now does this.
12695
12696         * src/common.h (backup_type): New decl.
12697         * src/common.h, src/misc.c, src/tar.c:
12698         Move include of backupfile.h to common.h.
12699
12700         * src/misc.c (maybe_backup_file):
12701         Pass backup_type to find_backup_file_name.
12702
12703         * src/list.c (print_header): Change sizes of uform and gform from 11 to
12704         UINTMAX_STRSIZE_BOUND.
12705
12706         * doc/tar.texi: Remove --bzip2.
12707         Fix @xref typos reported by latest makeinfo.
12708
12709         * Makefile.am (ACLOCAL_AMFLAGS): New macro.
12710         (SUBDIRS): Add m4.
12711         (M4DIR, ACINCLUDE_INPUTS): New macros.
12712         ($(srcdir)/acinclude.m4): New rule.
12713
12714         * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT,
12715         HAVE_INTTYPES_H, HAVE_LC_MESSAGES, HAVE_STPCPY): Remve #undefs;
12716         now generated automatically by autoconf.
12717
12718 1999-05-15  Paul Eggert  <eggert@twinsun.com>
12719
12720         * doc/tar.texi: Remove -y.
12721
12722 1999-04-09  Paul Eggert  <eggert@twinsun.com>
12723
12724         * src/system.h (INT_STRLEN_BOUND): Fix off-by-factor-of-10 typo
12725         (we were allocating too much storage).
12726         (uintmax_t): Don't declare; configure now does this.
12727
12728         * ABOUT-NLS: Update to gettext 0.10.35 edition.
12729
12730 1999-03-22  Paul Eggert  <eggert@twinsun.com>
12731
12732         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64010
12733
12734         * acinclude.m4 (AC_LFS_FLAGS):
12735         Don't use -mabi=n32 with GCC on IRIX 6.2; it's the default.
12736         (AC_LFS): -n32, -o32, and -n64 are CPPFLAGS, not CFLAGS.
12737         (jm_FUNC_MALLOC, jm_FUNC_REALLOC): New macros.
12738
12739         * configure.in (jm_FUNC_MALLOC, jm_FUNC_REALLOC):
12740         New macros; needed for latest GNU xmalloc.c.
12741
12742         * Makefile.am (noinst_HEADERS): Add quotearg.h, xalloc.h.
12743         (libtar_a_SOURCES): Add quotearg.c.
12744         * list.c: Include <quotearg.h>.
12745         (from_oct): Add forward decl.
12746         (read_header): Return HEADER_FAILURE if we can't parse the checksum.
12747         (from_oct): Report an error only if TYPE is nonzero.
12748         Quote any funny characters in bad header.
12749
12750 1999-03-20  Paul Eggert  <eggert@twinsun.com>
12751
12752         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64009
12753
12754         * acinclude.m4 (AC_LFS_FLAGS): Add support for IRIX 6.2 and later.
12755         (AC_LFS_SPACE_APPEND): Assume $2 is quoted properly; all callers
12756         changed.
12757         (AC_LFS): Simplify AIX revision number test.
12758
12759 1999-03-17  Paul Eggert  <eggert@twinsun.com>
12760
12761         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64008
12762
12763         * configure.in (AC_VALIDATE_CACHED_SYSTEM_TUPLE):
12764         Remove; it doesn't work that well
12765         with AC_CANONICAL_HOST.
12766         (fp_WITH_INCLUDED_MALLOC): Remove; we'll just use the system malloc.
12767
12768         * Makefile.am (EXTRA_DIST): Remove AC-PATCHES, AM-PATCHES, BI-PATCHES.
12769
12770         * Makefile.am (EXTRA_DIST): Remove gmalloc.c.
12771
12772         * acinclude.m4 (fp_WITH_INCLUDED_MALLOC): Remove.
12773
12774         * tar.texi: Fix bug-report addr.
12775
12776         * README: Remove --with-included-malloc.
12777         Upgrade version numbers of build software.
12778
12779 1999-03-07  Paul Eggert  <eggert@twinsun.com>
12780
12781         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64007.
12782
12783         * acinclude.m4 (AM_WITH_NLS): Port to Solaris 2.5.1,
12784         where bindtextdomain and gettext require -lintl.
12785         (AC_LFS_FLAGS): Simplify so that it only gets the flags;
12786         `no' means it failed.
12787         (AC_LFS_SPACE_APPEND, AC_LFS_MACRO_VALUE): New macros.
12788         (AC_LFS): Use them.  Set _FILE_OFFSET_BITS, _LARGEFILE_SOURCE, and
12789         _LARGE_FILES from LFS_CFLAGS, so that in the normal case we don't need
12790         to add anything to the command line (it's all in config.h).
12791         Put any extra -D and -I options into CPPFLAGS, the rest into CFLAGS.
12792
12793 1999-03-01  Paul Eggert  <eggert@twinsun.com>
12794
12795         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64006.
12796
12797         * acinclude.m4 (AC_LFS_FLAGS): Port to AIX 4.2.
12798
12799         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
12800         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
12801         uid_from_oct, uintmax_from_oct): Use TYPE_MAXIMUM instead of macros
12802         like OFF_MAX, which are not reliable
12803         (e.g. OFF_MAX in AIX 4.2 is incorrect).
12804         * src/system.h (GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX, OFF_MAX,
12805         SIZE_MAX, TIME_MAX,UID_MAX, UINTMAX_MAX):  Remove; no longer used.
12806
12807         * src/incremen.c (get_directory_contents):
12808         Don't use statx if _LARGE_FILES; it doesn't work under AIX 4.2.
12809         Have statx depend on STX_HIDDEN, not AIX.
12810
12811         * src/create.c (to_oct):
12812         New parameter substitute, giving a substitute value to use
12813         when the original value is out of range.  Do not append a space to the
12814         output; modern tars don't.  When a value is out of range, specify the
12815         maximum value, not the number of bits.
12816         (GID_NOBODY, UID_NOBODY): New macros.
12817         (gid_to_oct, uid_to_oct): Use them as substitutes.
12818         (finish_header): Do not assume that UINTMAX_TO_OCT appends a space.
12819         (dump_file): Check whether the file changed as we read it.
12820
12821         * src/rmt.c (main): Remove suspicious AIX/386 code.
12822
12823 1999-02-19  Paul Eggert  <eggert@twinsun.com>
12824
12825         * intl/localealias.c (read_alias_file): Don't assume that memcpy
12826         returns a type compatible with char *; it doesn't on SunOS
12827         4.1.4 with Sun cc, since <string.h> doesn't declare memcpy.
12828
12829         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64005.
12830
12831         * src/tar.c (long_options, usage): Prefer --unbzip2 to --bunzip2.
12832         * doc/tar.texi: Add --bzip2, --unbzip2 options.
12833
12834         * configure.in (AC_CANONICAL_HOST, AC_VALIDATE_CACHED_SYSTEM_TUPLE):
12835         Add.
12836         (AC_LINK_FILES): Omit; AM_GNU_GETTEXT now does this.
12837         (AC_OUTPUT): Omit munging of po/Makefile; AM_GNU_GETTEXT now does this.
12838         * acinclude.m4 (AM_WITH_NLS):
12839         Update to latest gettext version (serial 5).
12840         (AC_LFS_FLAGS): New macro
12841         (AC_LFS): Use it.  Append to CFLAGS, LDFLAGS, LDLIBS instead of
12842         working only with unset variables.  Append to CFLAGS, not CPPFLAGS.
12843         Work properly in cross-compilation scenario, by checking for getconf
12844         with AC_CHECK_TOOL and by ditching uname in favor of
12845         AC_CANONICAL_HOST and $host_os.  Add --disable-lfs option.
12846
12847         * lib/getdate.y: Update to fileutils 4.0 getdate.y, with one patch:
12848         replace FORCE_ALLOCA_H with HAVE_ALLOCA_H.
12849         * lib/Makefile.am (AUTOMAKE_OPTIONS): Append ../src/ansi2knr,
12850         since getdate.y now uses ANSI code.
12851
12852         * config.guess, config.sub: New files; taken from automake 1.4.
12853
12854         * intl/Makefile.in, intl/VERSION, intl/bindtextdom.c,
12855         intl/cat-compat.c, intl/dcgettext.c, intl/dgettext.c,
12856         intl/explodename.c, intl/finddomain.c, intl/gettext.c,
12857         intl/gettext.h, intl/gettextP.h, intl/hash-string.h,
12858         intl/l10nflist.c, intl/libgettext.h, intl/loadinfo.h,
12859         intl/loadmsgcat.c, intl/localealias.c, intl/textdomain.c:
12860         Update to GNU gettext 0.10.35, with patches as per GCC snapshot 990109.
12861
12862 1999-02-01  Paul Eggert  <eggert@twinsun.com>
12863
12864         * src/tar.c: Update copyright.
12865
12866         * NEWS: 1.12.64004
12867
12868 1999-02-01  Paul Eggert  <eggert@twinsun.com>
12869
12870         * NEWS, configure.in: Version 1.12.64004
12871
12872         * configure.in (AC_LFS): Use this macro, instead of open-coding it.
12873
12874         * acinclude.m4 (AC_LFS, AM_PROG_CC_STDC): New macros.
12875
12876         * src/extract.c (extract_archive): Fix bug when extracting sparse
12877         files: they were trashing the tar file header.
12878
12879         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
12880         Add -y or --bzip2 or --bunzip2 option.
12881
12882 1999-01-30  Paul Eggert  <eggert@twinsun.com>
12883
12884         * src/names.c (cached_no_such_uname, cached_no_such_gname,
12885         cached_no_such_uid, cached_no_such_gid): New vars.
12886         (uid_to_uname, gid_to_gname, uname_to_uid, gname_to_gid):
12887         Cache failures, too.
12888
12889         * src/tar.c (decode_options):
12890         Don't pass names longer than UNAME_FIELD_SIZE to
12891         uname_to_uid, as it messes up the cache.  Similarly for gname_to_uid.
12892
12893 1999-01-27  Paul Eggert  <eggert@twinsun.com>
12894
12895         * NEWS, configure.in: Version 1.12.64003
12896
12897         * src/buffer.c (backspace_output, close_archive):  Cast
12898         rmtlseek position arg to off_t, for benefit of K&R compilers
12899         with long long.
12900         * src/compare.c (verify_volume): Likewise.
12901
12902         * NEWS, configure.in: Version 1.12.64002
12903
12904         * src/create.c (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
12905         off_to_oct, size_to_oct, time_to_oct, uid_to_oct):
12906         Cast arg to uintmax_t for benefit of pre-ANSI compilers with long long.
12907         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
12908         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
12909         uid_from_oct): Likewise.
12910
12911 1999-01-25  Paul Eggert  <eggert@twinsun.com>
12912
12913         * incremen.sh: Fix timing bug in regression test.
12914
12915 1999-01-22  Paul Eggert  <eggert@twinsun.com>
12916
12917         * NEWS, configure.in: Update version
12918
12919         * Makefile.am (localedir): Change to $(datadir)/locale.
12920         (DEFS): New macro, defining LOCALEDIR.
12921         (tar.o, tar._o, rmt.o, rmt._o): Remove.
12922         (INCLUDES): Add -I..
12923
12924         * Makefile.am (localedir): Change to $(datadir)/locale.
12925
12926 1999-01-21  Paul Eggert  <eggert@twinsun.com>
12927
12928         * NEWS, README, configure.in: Unofficial version 1.12.64001.
12929
12930         * tests/Makefile.am (localedir): Change to $(datadir)/locale.
12931         * src/Makefile.am (localedir): Likewise.
12932         (DEFS): New macro, defining LOCALEDIR.
12933         (tar.o, tar._o, rmt.o, rmt._o): Remove.
12934         (INCLUDES): Add `-I..'.
12935
12936         * tests/incremen.sh: Fix timing bug.
12937
12938 1999-01-20  Paul Eggert  <eggert@twinsun.com>
12939
12940         * NEWS, README, configure.in: Unofficial version 1.12.64000.
12941         `lfs.7' changed to `64000' in version number
12942         to conform to gnits standards.
12943
12944         * COPYING, INSTALL, doc/texinfo.tex, install-sh, missing,
12945         mkinstalldirs, ansi2knr.c: Update to latest public versions.
12946
12947         Rebuild with automake 1.4 and autoconf 2.13, to work around some
12948         porting problems.
12949
12950 1998-12-07  Paul Eggert  <eggert@twinsun.com>
12951
12952         * NEWS, README, configure.in: Unofficial version 1.12.lfs.6.
12953
12954         * src/list.c (read_header):
12955         Accept file names as specified by POSIX.1-1996 section 10.1.1.
12956
12957 1998-11-30  Paul Eggert  <eggert@twinsun.com>
12958
12959         * configure.in: Quote the output of uname.
12960
12961         * src/extract.c (set_stat): chmod after chown even when not root;
12962         if we are using --same-owner this is needed e.g. on Solaris 2.5.1.
12963
12964 1998-11-15  Paul Eggert  <eggert@twinsun.com>
12965
12966         * NEWS, README, configure.in: Unofficial version 1.12.lfs.5.
12967
12968         * configure.in (ac_test_CPPFLAGS, ac_test_LDFLAGS, ac_test_LIBS,
12969         ac_getconfs, ac_result): Special case for HP-UX 10.20 or later.
12970
12971 1998-10-28  Paul Eggert  <eggert@twinsun.com>
12972
12973         * NEWS, README, configure.in: Unofficial version 1.12.lfs.4.
12974
12975         * src/system.h (voidstar): Use void * if __STDC__ is defined,
12976         not merely nonzero.
12977
12978         * src/rtapelib.c: Don't use rexec code unless compiled with WITH_REXEC.
12979         On many installations, rexec is disabled.
12980
12981 1998-08-07  Paul Eggert  <eggert@twinsun.com>
12982
12983         * NEWS, README, configure.in: Unofficial version 1.12.lfs.3.
12984
12985         * src/names.c (uid_to_uname, gid_to_gname): Don't used cached name
12986         for nameless users and groups.
12987
12988 1998-02-17  Paul Eggert  <eggert@twinsun.com>
12989
12990         * NEWS, README, configure.in: Unofficial version 1.12.lfs.2.
12991         * NEWS, README: Add explanation of why this isn't an official version.
12992
12993 1998-02-02  Paul Eggert  <eggert@twinsun.com>
12994
12995         * NEWS, README, configure.in: Unofficial version 1.12.lfs.1.
12996         This is an unofficial version.
12997
12998 1997-12-17  Paul Eggert  <eggert@twinsun.com>
12999
13000         * src/incremen.c (ST_DEV_MSB): New macro.
13001         (NFS_FILE_STAT): Use most significant bit of st_dev,
13002         even if it's unsigned.
13003
13004 1997-12-08  Paul Eggert  <eggert@twinsun.com>
13005
13006         * src/system.h (ST_NBLOCKS): Fix typo in definition.
13007
13008 1997-11-19  Paul Eggert  <eggert@twinsun.com>
13009
13010         * configure.in (HAVE_INTTYPES_H):
13011         Don't ignore cache variable if it's already set.
13012
13013 1997-11-10  Paul Eggert  <eggert@twinsun.com>
13014
13015         * src/rmt.c (main): Don't assume mt_count is of type daddr_t.
13016         * src/delete.c (records_read): Now off_t.
13017         (move_archive): Don't assume mt_count is of type daddr_t.
13018
13019 1997-10-30  Paul Eggert  <eggert@twinsun.com>
13020
13021         * configure.in (CPPFLAGS, LDFLAGS, LIBS):
13022         Set to appropriate values if large file support
13023         needs explicit enabling.
13024         (HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING, daddr_t, major_t, minor_t,
13025         ssize_t):
13026         New macros to configure.
13027         (AC_TYPE_MODE_T, AC_TYPE_PID_T, AC_TYPE_OFF_T): Add.
13028
13029         * acconfig.h (daddr_t, HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING,
13030         major_t, minor_t, ssize_t): New macros.
13031
13032         * src/arith.h (TARLONG_FORMAT):
13033         Fix typo: %uld -> %lu.  Use unsigned when long long
13034         (%lld -> %llu).
13035         (add_to_tarlong_helper, mult_tarlong_helper): 2nd arg is now unsigned long.
13036         (add_to_tarlong, mult_tarlong): Cast 2nd arg to unsigned long.
13037
13038         * src/arith.c (add_to_tarlong_helper, mult_tarlong_helper):
13039         2nd arg is now unsigned long.
13040
13041         * src/rmt.c (allocated_size): Now size_t, and now initialized to 0.
13042         (prepare_record_buffer): Arg is now size_t.
13043         Remove now-useless casts.
13044
13045         (main): Use `long' for status, so that it can store ssize_t.
13046         Use daddr_t, mode_t, size_t, off_t when appropriate.
13047         Convert daddr_t and off_t values ourselves, since they might be longer
13048         than long.  Convert other types using `long' primitives.
13049         When processing MTIOCTOP, do not try to pass resulting
13050         count back, since it won't work (it could be too large) and it's
13051         not expected anyway.
13052
13053         * src/update.c:
13054         (append_file) Use off_t, size_t, ssize_t when appropriate.  Remove
13055         now-useless casts.  Use unsigned long to print *_t types, except use
13056         STRINGIFY_BIGINT for off_t.
13057         (update_archive): Cast -1 to dev_t when necessary.
13058
13059         * src/tar.c (check_decimal):
13060         Now returns 1 if successful, 0 otherwise, and returns
13061         uintmax_t value into new arg.  Check for arithmetic overflow.
13062         (decode_options): Avoid overflow if record_size fits in size_t but not int.
13063         Check for overflow on user or group ids.
13064
13065         * src/compare.c (diff_init, process_rawdata, read_and_process,
13066         diff_sparse_files, diff_archive):
13067         Use off_t, pid_t, size_t, ssize_t when appropriate.
13068         Remove now-useless casts.  Use unsigned long to print *_t types,
13069         except use STRINGIFY_BIGINT for off_t.
13070
13071         (process_noop, process_rawdata, process_dumpdir, read_and_process):
13072         Size arg is now size_t.
13073
13074         (diff_sparse_files): Arg is now off_t.  Check for size_t overflow
13075         when allocating buffer.
13076
13077         * src/rtapelib.c:
13078         (do_command, rmt_open__, rmt_read__, rmt_lseek__, rmt_ioctl__):
13079         Use pid_t, size_t, ssize_t when appropriate.  Remove now-useless casts.
13080         Use unsigned long to print *_t types, except use STRINGIFY_BIGINT for
13081         off_t.
13082
13083         (get_status_string, get_status_off): New function.
13084         (get_status): Now returns long, so that it can store ssize_t.
13085         Invoke get_status_string to do the real work.
13086         (rmt_read__, rmt_write__): Now returns ssize_t. Size arg is now size_t.
13087         (rmt_lseek__): Now returns off_t, using new get_status_off function.
13088         (rmt_ioctl__): Convert mt_count by hand,
13089         since it might be longer than long.
13090
13091         * src/mangle.c (extract_mangle):
13092         Check for overflow when converting off_t to size_t.
13093         Use off_t, size_t when appropriate.  Remove now-useless casts.
13094
13095         * src/system.h (mode_t): Remove; now done by autoconf.
13096         (ST_NBLOCKS): Do not overflow if st_size is near maximum.
13097         Return number of ST_NBLOCKSIZE-byte blocks,
13098         not number of 512-byte blocks;
13099         this also helps to avoid overflow.
13100         (st_blocks): Declare if needed.
13101         (ST_NBLOCKSIZE): New macro.
13102         (<limits.h>, <inttypes.h>): Include if available.
13103         (CHAR_BIT): New macro.
13104         (uintmax_t): New typedef.
13105         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND,
13106         UINTMAX_STRSIZE_BOUND, GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX,
13107         OFF_MAX, SIZE_MAX, TIME_MAX, UID_MAX, UINTMAX_MAX): New macros.
13108
13109         * src/names.c (name_init):
13110         Fix typo in error message: FILE* was passed, but char*
13111         was wanted.
13112
13113         (read_name_from_file, name_gather, addname, name_match, name_scan,
13114         add_exclude): Use size_t when appropriate.  Remove now-useless casts.
13115
13116         (exclude_pool_size, allocated_exclude_pool_size): Now size_t.
13117
13118         * src/extract.c (newdir_umask, current_umask): Now mode_t.
13119         (extract_sparse_file): Args now use off_t.
13120
13121         (set_mode, set_stat, make_directories, extract_sparse_file,
13122         extract_archive): Use off_t, size_t, ssize_t when appropriate.  Remove
13123         now-useless casts.  Use unsigned long to print *_t types, except use
13124         STRINGIFY_BIGINT for off_t.
13125
13126         * src/misc.c (quote_copy_string):
13127         Use size_t when appropriate.  Remove now-useless casts.
13128
13129         * src/list.c (read_and, list_archive, read_header, decode_mode,
13130         print_header, print_for_mkdir):
13131         Use mode_t, off_t, size_t when appropriate.  Remove
13132         now-useless casts.  Use unsigned long to print *_t types, except use
13133         STRINGIFY_BIGINT for off_t.
13134
13135         (read_header): Check for overflow when converting header size.
13136
13137         (from_oct): Now static.  Now returns uintmax_t.  `where' arg is now
13138         const char *.  Size arg is now size_t.  Now takes new type and maxval
13139         args.  Compute result using uintmax_t, not long.  Report error if
13140         field does not contain octal number in range.
13141         (gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
13142         off_from_oct, size_from_oct, time_from_oct, uid_from_oct,
13143         uintmax_from_oct): New functions.
13144
13145         (stringify_uintmax_t_backwards): New function.
13146
13147         (decode_mode, print_for_mkdir): Mode arg is now mode_t.
13148         (skip_file): Offset arg is now off_t.
13149
13150         * src/buffer.c (record_start_block, save_totsize, save_sizeleft,
13151         real_s_totsize, real_s_sizeleft, current_block_ordinal):
13152         Now off_t.
13153         (write_error): Arg is now ssize_t.
13154         (child_pid): Now pid_t.
13155         (available_space_after): Now size_t.
13156
13157         (child_open_for_compress, child_open_for_uncompress, flush_write,
13158         open_archive, flush_write, write_error, flush_read, close_archive):
13159         Use pid_t, ssize_t, size_t when appropriate.  Remove now-useless
13160         casts.  Use unsigned long to print *_t types, except use
13161         STRINGIFY_BIGINT for off_t.
13162
13163         * src/delete.c (records_read): Now daddr_t.
13164         (move_archive): Arg is now daddr_t.  Check for overflow when
13165         computing offset.
13166         (move_archive, delete_archive_members): Use daddr_t, off_t when
13167         appropriate.  Remove now-useless casts.
13168
13169         * src/rmt.h (rmt_read__, rmt_write__): Now returns ssize_t.
13170         (rmt_lseek): Now returns off_t.
13171
13172         * src/create.c (to_oct):
13173         Now static.  Value arg is now uintmax_t.  Accept new args
13174         giving name of type of octal field, for error messages.  Report an
13175         error if the value is too large to fit in the field.
13176         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
13177         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct): New functions.
13178
13179         (write_eot, write_long, finish_header, deal_with_sparse,
13180         finish_sparse_file, dump_file): Use dev_t, off_t, ssize_t, size_t when
13181         appropriate.  Remove now-useless casts.  Use unsigned long to print
13182         *_t types, except use STRINGIFY_BIGINT for off_t.
13183
13184         (find_new_file_size): 1st arg is now off_t*.
13185         (finish_sparse_file): Args now use off_t, not long.
13186         Check for lseek error.
13187         (create_archive, dump_file): Cast -1 to dev_t when necessary.
13188         (dump_file): Device arg is now dev_t.
13189         Avoid overflow when testing whether file has holes
13190         by using the new ST_NBLOCKSIZE macro.
13191
13192         * src/incremen.c (struct accumulator, add_to_accumulator,
13193         get_directory_contents, add_hierarchy_to_namelist, gnu_restore):
13194         Use size_t for sizes.
13195         (struct directory, get_directory_contents, add_hierarchy_to_namelist):
13196         Use dev_t, ino_t for devices and inodes.
13197         (gnu_restore): Use off_t for file offsets.
13198         (struct directory): Use char for flags.  Add new flag `nfs'.
13199         (nfs): New constant
13200         (NFS_FILE_STAT): New macro.
13201         (note_directory): Accept struct stat * instead of
13202         device and inode number.  All callers changed.
13203         (note_directory, get_directory_contents):
13204         Use NFS_FILE_STAT to determine whether directory is an NFS directory.
13205         (write_dir_file): Cast time_t to unsigned long before printing as %lu.
13206
13207         * src/common.h (record_size, struct name, struct sp_array,
13208         available_space_after):
13209         Use size_t for sizes.
13210         (save_sizeleft, save_totsize, current_block_ordinal, skip_file):
13211         Use off_t for file offsets.
13212         (struct name): dir_contents is now const char *, not char *.
13213         (dump_file, get_directory_contents): Use dev_t for devices.
13214         (to_oct): Remove decl.
13215         (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, SIZE_TO_OCT,
13216         UID_TO_OCT, UINTMAX_TO_OCT, OFF_TO_OCT, TIME_TO_OCT, STRINGIFY_BIGINT,
13217         GID_FROM_OCT, MAJOR_FROM_OCT, MINOR_FROM_OCT, MODE_FROM_OCT,
13218         OFF_FROM_OCT, SIZE_FROM_OCT, TIME_FROM_OCT, UID_FROM_OCT,
13219         UINTMAX_FROM_OCT): New macros.
13220         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
13221         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
13222         stringify_uintmax_t_backwards, gid_from_oct, major_from_oct,
13223         minor_from_oct, mode_from_oct, off_from_oct, size_from_oct,
13224         time_from_oct, uid_from_oct, uintmax_from_oct): New decls.
13225         (print_for_mkdir): 2nd arg is now mode_t.
13226
13227         -----
13228
13229         See ChangeLog.1 for earlier changes.
13230
13231         -----
13232 \f
13233 Local Variables:
13234 mode: change-log
13235 version-control: never
13236 buffer-read-only: t
13237 End: