* tests/Makefile.am (clean-local): Don't attempt to run
[debian/tar] / ChangeLog
1 2005-09-21  Paul Eggert  <eggert@cs.ucla.edu>
2
3         * tests/Makefile.am (clean-local): Don't attempt to run
4         $(TESTSUITE) if it doesn't exist.  Problem reported by
5         Eric Blake.
6
7 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
8
9         Don't filter time stamps through the resolution supported
10         by struct stat; keep them to full nanosecond resolution.
11         This affects behavior only on older hosts or file systems
12         that have lower-resolution time stamps.
13         * src/common.h (OLDER_STAT_TIME): Parenthesize arg.
14         (OLDER_TAR_STAT_TIME): New macro.
15         (code_timespec): New function.
16         (BILLION, LOG10_BILLION, TIMESPEC_STRSIZE_BOUND): New constants.
17         * src/compare.c (diff_file): Use full time stamp resolution.
18         * src/create.c (start_header, dump_file0): Likewise.
19         (start_header, dump_file0): Adjust to new structure layout.
20         (dump_regular_finish): Simplify by using timespec_cmp.
21         * src/extract.c (struct delayed_set_stat): Don't store stat info
22         that we don't need, to save space.  All uses changed.
23         (struct delayed_set_stat, struct delayed_link, file_newer_p):
24         (create_placeholder_file, extract_link, apply_delayed_links):
25         Use full time stamp resolution.
26         (check_time): Use code_timespec rather than rolling our own code.
27         (set_stat, delay_set_stat): Arg now points to tar_stat_info to
28         avoid losing time information.  All callers changed.
29         * src/list.c (read_and, decode_header, print_heaeder):
30         Use full time stamp resolution.
31         * src/misc.c (code_timespec): New function.
32         * src/tar.h (struct tar_stat_info): Record atime, mtime, ctime
33         separately, for benefit of hosts with lower resolution.
34         * src/update.c (update_archive): Use full time stamp resolution.
35         * src/xheader.c (code_time): Use new code_timespec function
36         to simplify code.
37         (atime_coder, atime_decoder, ctime_coder, ctime_decoder):
38         (mtime_coder, mtime_decoder): Use full time stamp resolution.
39
40         Report time stamps to full resolution in environment.
41         Report memory allocation failures rather than ignoring them.
42         * src/system.c (time_to_env): New function.
43         (oct_to_env, str_to_env, chr_to_env): Report memory allocation failures.
44         (stat_to_env): Report full resolution in time stamps.
45
46 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
47
48         Merge changes from gnulib for file system sub-second time stamps.
49         * configure.ac: Remove checks for struct stat.st_spare1, struct
50         stat.st_atim.tv_nsec, struct stat.st_atimespec.tv_nsec, struct
51         stat.st_atimensec, as gnulib now does this for us.
52         Similarly for LIB_CLOCK_GETTIME.
53         * gnulib.modules: Add stat-time.
54         * lib/.cvsignore: Add stat-time.h.
55         * src/common.h: Include stat-time.h.
56         (timespec_lt): Remove.  All callers changed to use timespec_cmp.
57         (get_stat_atime, get_stat_ctime, get_stat_mtime):
58         (set_stat_atime, set_stat_ctime, set_stat_mtime):
59         Remove; now defined by stat-time.h.
60
61 2005-09-14  Sergey Poznyakoff  <gray@gnu.org.ua>
62
63         * src/incremen.c (list_dumpdir): New function. Used to dump
64         contents of GNUTYPE_DUMPDIR blocks.
65         * src/common.h (list_dumpdir): Likewise.
66         * src/list.c (list_archive): Use list_dumpdir() to display
67         GNUTYPE_DUMPDIR blocks. Do that only if two or more -v options are
68         given.
69
70 2005-09-12  Paul Eggert  <eggert@cs.ucla.edu>
71
72         * lib/.cvsignore: Adjust to current gnulib and modules used.
73         Add getdelim.c, getdelim.h, mbchar.c, mbchar.h, mbuiter.h, memchr.c,
74         pipe-safer.c, size_max.h, strdup.c, strdup.h, strnlen.h, strnlen1.c,
75         strnlen1.h, unistd--.h.
76         Remove getndelim2.c, getndelim2.h, pathmax.h, sysexits.h, xstrdup.c.
77
78         Treat fishy-looking hard links like fishy-looking symlinks.
79         * src/extract.c (struct delayed_set_stat): Rename after_symlinks
80         member to after_links.  All uses changed.
81         (struct delayed_link): Renamed from struct delayed_symlink.
82         All uses changed.  New member is_symlink.
83         (delayed_link_head): Renamed from delayed_symlink_head.  All uses
84         changed.
85         (create_placeholder_file): New function, taken from extract_symlink.
86         (extract_link): Create placeholders for fishy-looking hard links.
87         (extract_symlink): Move code into create_placeholder_file.
88         (apply_delayed_links): Renamed from apply_delayed_symlinks.
89         All uses changed.  Create both hard links and symlinks.
90
91 2005-09-03  Paul Eggert  <eggert@cs.ucla.edu>
92
93         * README-alpha: Modernize description of software required for
94         developers.
95
96 2005-09-03  Sergey Poznyakoff  <gray@gnu.org.ua>
97
98         * gnulib.modules: Add strdup
99         * src/incremen.c (purge_directory): Do not dereference symbolic
100         links. Bug reported by Ralph Corderoy <ralph@inputplus.co.uk> and
101         David Brown <davidb@davidb.org>
102         * tests/incr01.at: New test.
103         * tests/Makefile.am: Add incr01.at
104         * tests/testsuite.at: Likewise
105         * THANKS: Updated
106
107 2005-08-17  Sergey Poznyakoff  <gray@gnu.org.ua>
108
109         * src/incremen.c (read_directory_file): Use strtoumax to read
110         snapshot file contents.
111         (write_directory_file_entry): Use umaxtostr().
112
113 2005-07-31  Sergey Poznyakoff  <gray@gnu.org.ua>
114
115         * src/create.c (file_dumpable_p,dump_file0): Fix handling of
116         sparse files to /dev/null with --totals option.
117         * tests/update.at: Remove dependency on file order.
118
119 2005-07-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
120
121         * doc/tar.texi: Fix typo.
122
123 2005-07-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
124
125         * tests/pipe.at: Pipe the output from `tar xfv' through sort.
126
127 2005-06-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
128
129         * src/sparse.c (tar_sparse_init): Fill structure with zeros. Call
130         sparse_select_optab(). All callers updated.
131         (sparse_member_p, sparse_fixup_header): Use tar_sparse_init().
132
133 2005-06-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
134
135         * src/sparse.c (pax_sparse_member_p): Checking member size
136         vs. file size is not reliable enough. Use sparse_map_avail.
137
138         * tests/star/gtarfail.at: Adapt to the new output format
139         * tests/star/gtarfail2.at: Likewise
140         * tests/star/multi-fail.at: Likewise
141         * tests/star/pax-big-10g.at: Likewise
142         * tests/star/ustar-big-2g.at: Likewise
143         * tests/star/ustar-big-8g.at: Likewise
144
145         * tests/sparse03.at: New test.
146         * tests/Makefile.am: Add sparse03.at
147         * tests/testsuite.at: Likewise
148
149         * src/xheader.c (size_decoder): Do not set archive_file_size.
150
151         Fix bugs introduced yesterday:
152
153         * src/sparse.c (tar_sparse_init):  Initialize
154         dimped_size to 0.
155         (sparse_scan_file): Initialize archive_file_size to 0. The
156         variable keeps size of the file *as stored in the archive*, not
157         the size reported by stat.
158
159 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
160
161         A sweep of the sparse code prompted by a bug report by Jim Meyering.
162         * src/sparse.c: Include <inttostr.h>.
163         (struct tar_sparse_file): offset and dumped_size are off_t, not
164         size_t.  optab is now const *.
165         (dump_zeros): Return bool success flag, not off_t.
166         All callers changed.
167         Use a constant-zero buffer rather than clearing a buffer each time.
168         Don't mess up if write fails.
169         (dump_zeros, check_sparse_region):
170         Don't assume off_t is no wider than size_t.
171         (tar_sparse_init): Don't bother clearing a field that is already clear.
172         (zero_block_p): First arg is const *, not *.
173         (clear_block, SPARSES_INIT_COUNT): Remove.
174         (sparse_add_map): First arg is now struct start_stat_info *, not
175         struct tar_sparse_file *.  All callers changed.
176         Use x2nrealloc to check for size_t overflow.
177         (parse_scan_file): Cache commonly-used parts of file.
178         Use an auto buffer, not a static one.
179         Don't bother clearing the buffer; not needed.
180         Don't bother clearing items that are already clear.
181         (oldgnu_optab, star_optab, pax_optab): Now const.
182         (sparse_dump_region): Don't bother clearing the buffer before
183         reading into it; just clear the parts that aren't read into.
184         (sparse_dump_file): Clear the whole local variable 'file'.
185         (diff_buffer): Remove; now a local var.
186         (check_sparse_region): Don't bother clearing buffer before
187         reading into it.  Don't assume off_t is promoted to long.
188         (oldgnu_get_sparse_info, star_get_sparse_info):
189         Use an auto status, not static.
190         * src/tar.h (struct tar_stat_info): had_trailing_slash is
191         now bool, not int.
192         * src/xheader.c (sparse_offset_coder, sparse_numbytes_coder):
193         Rewrite to avoid cast.
194         (sparse_offset_decoder, sparse_numbytes_decoder):
195         Diagnose excess entries rather than crashing.
196
197 2005-06-22  Jim Meyering  <jim@meyering.net>
198
199         * src/common.h (timespec_lt): Add a return type: bool.
200
201 2005-06-21  Paul Eggert  <eggert@cs.ucla.edu>
202
203         Further improvements inspired by Jim Meyering's fixes.
204
205         * NEWS: Better support for full-resolution time stamps.
206         The -v option now prints time stamps only to 1-minute resolution.
207         * gnulib.modules: Add utimens.
208         * lib/.cvsignore: Add imaxtostr.c, inttostr.c, inttostr.h,
209         offtostr.c, umaxtostr.c, utimens.c, utimens.h.  Remove paxconvert.c.
210         * lib/Makefile.tmpl (libtar_a_SOURCES): Remove paxconvert.c.
211         * lib/paxconvert.c: Remove; superseded by umaxtostr.c.
212         * po/POTFILES.in: Remove lib/paxconvert.c.  Add lib/xalloc-die.c,
213         lib/obstack.c.
214         * src/buffer.c (set_start_time, compute_duration, start_time):
215         Use gettime rather than rolling our own code.
216         * src/common.h (OLDGNU_NAME_FIELD_SIZE, MAXOCTAL11, MAXOCTAL7): Remove.
217         (newer_ctime_option): Remove.
218         (timespec_lt): New function.
219         (OLDER_STAT_TIME): Use it.
220         (string_to_chars): First arg is char const *, not char *.
221         (tartime): Time arg is now struct timespec.  New bool arg.
222         All callers changed.
223         (code_ns_fraction): New decl.
224         (sys_stat_nanoseconds): Remove decl.
225         (get_stat_atime, get_stat_ctime, get_stat_mtime): New functions.
226         (set_stat_atime, set_stat_ctime, set_stat_mtime): New functions.
227         * src/compare.c: Include utimens.h rather than rolling our own.
228         (diff_dir, diff_file, diff_link, diff_symlink, diff_special):
229         Prototype.
230         (diff_dumpdir, diff_multivol): Prototype.
231         (diff_file): Support higher-resolution time stamps.
232         * src/create.c: Include utimens.h rather than rolling our own.
233         (MAX_OCTAL_VAL): New macro.
234         (tar_copy_str, string_to_chars): Don't bother to zero-fill;
235         the destination is already zeroed.
236         (string_to_chars): First arg is char const *.
237         (start_private_header): Use MINOR_TO_CHARS, not MAJOR_TO_CHARS,
238         for minor device number.
239         (write_header_name, dump_hard_link, dump_file0):
240         Simplify test for old GNU format.
241         (start_header): Put in placeholders for uid, etc., even when
242         using extended headers, for benefit of older "tar" implementations.
243         Don't assume uintmax_t is wider than 32 bits.
244         Output extended header for mtime if needed.
245         (dump_regular_finish, dump_file0):
246         Support extended time stamp resolution.
247         * src/extract.c: Include utimens.h rather than rolling our own.
248         (check_time): Support extended time stamp resolution.
249         * src/list.c: Include <inttostr.h>.
250         (tartime): Use umaxtostr rather than stringify_uintmax_t_backwards.
251         * src/xheader.c: Include <inttostr.h>.
252         Do not include <xstrtol.h>.
253         (strtoimax) [!HAVE_DECL_STRTOIMAX && !defined strtoimax]: New decl.
254         (strtoumax) [!HAVE_DECL_STRTOUMAX && !defined strtoumax]: New decl.
255         (BILLION, LOG10_BILLION): New constants.
256         (to_decimal): Remove; superseded by inttostr.  All callers changed
257         to use umaxtostr.
258         (xheader_format_name): Don't assume pids and uintmax_t values
259         fit in 63 bytes (!) when printed.
260         (decode_record): Don't bother to check for ERANGE; an out of range
261         value must be treater than len_max anyway.
262         If the length is out of range, output it in the diagnostic.
263         (format_uintmax): Remove; all callers changed to use umaxtostr.
264         (xheader_print): Don't assume sizes can be printed in 99 bytes (!).
265         (out_of_range_header): New function.
266         (decode_time): Use it.
267         (code_time): Accept struct timespec, not time_t and unsigned long.
268         All callers changed.  Size sbuf properly, and remove unnecessary check.
269         Don't assume time stamps can fit in 199 bytes.
270         Handle negative time stamps.  Handle fractional time stamps
271         more consistently.  Don't output unnecessary trailing zeros.
272         (decode_time): Yield struct timespec, not time_t and unsigned long.
273         All callers changed.
274         Handle negative time stamps.  Truncate towards minus infinity
275         consistently.  Improve overflow checks, and output a better
276         diagnostic on overflow.
277         (code_num): Don't assume uintmax_t can be printed in 99 bytes (!).
278         (decode_num): New function, for better diagnostics.
279         (atime_coder, atime_decoder, gid_decoder, ctime_coder):
280         (ctime_decoder, mtime_coder, mtime_decoder, size_decoder):
281         (uid_decoder, sparse_size_decoder, sparse_numblocks_decoder):
282         (sparse_offset_decoder, sparse_numbytes_decoder):
283         Use decode_num, etc., instead of xstrtoumax, etc.
284
285 2005-06-21  Jim Meyering  <jim@meyering.net>
286
287         Carefully crafted invalid headers can cause buffer overrun.
288         Invalid header fields go undiagnosed.
289         Some valid time strings are ignored.
290
291         * src/xheader.c (sparse_numblocks_decoder): Remove unchecked use
292         of `calloc'.  Use xcalloc instead.
293         (decode_time, gid_decoder, size_decoder, uid_decoder):
294         (sparse_size_decoder, sparse_offset_decoder, sparse_numblocks_decoder):
295         Ensure that the result of calling xstrtoumax is no larger than
296         the maximum value for the target type.  Upon any failure, exit with
297         a diagnostic.
298         (sparse_numblocks_decoder): Avoid buffer overrun/heap corruption:
299         use x2nrealloc, rather than `n *= 2' and xrealloc(p, n,....
300         (decode_time): Rewrite to accept time strings like
301         1119018481.000000000.  Before, such strings were always ignored.
302
303 2005-06-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
304
305         * src/create.c (dump_file0): Check for is_avoided_name()
306         first. Fixes bug reported by Martin Lohmeier
307         <martin@mein-horde.de>
308         * tests/update.at: New file
309         * tests/Makefile.am (TESTSUITE_AT): Add update.at
310         * tests/testsuite.at: Likewise
311
312 2005-06-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
313
314         * configure.ac (AC_STRUCT_ST_BLKSIZE)
315         (AC_STRUCT_ST_BLOCKS): Removed. Handled by system.m4.
316
317 2005-06-02  Paul Eggert  <eggert@cs.ucla.edu>
318
319         * src/names.c (excluded_name): excluded_filename ->
320         excluded_file_name, because the name was changed in gnulib.
321
322 2005-05-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
323
324         * src/tar.c (read_name_from_file,update_argv): Automatically
325         detect nul-terminated list files.
326         * NEWS: Updated
327
328 2005-05-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
329
330         * scripts/backup.sh.in: Bugfixes.
331
332 2005-05-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
333
334         * scripts/backup.in: Minor fixes
335         * scripts/backup.sh.in (mt_begin,mt_rewind)
336         (mt_offline,mt_status): Use $MT to invoke mt
337         (init_common): Set --rsh-command option for mt if TAPE_FILE is a
338         remote archive.
339         * doc/tar.texi: Document new backup scripts behavior
340
341 2005-05-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
342
343         * lib/.cvsignore: Updated
344         * lib/Makefile.tmpl: Add new paxutils files
345         * po/POTFILES.in: Likewise
346         * src/buffer.c: Update invocations of safer_name_suffix()
347         * src/create.c: Likewise
348         * src/extract.c: Likewise
349         * src/xheader.c: Likewise
350         * src/common.h: Include paxlib.h instead of paxerror.h
351         (safer_name_suffix,removed_prefixes_p): Removed. The functions are
352         imported from paxutils
353         * src/names.c (hash_string_hasher,hash_string_compare)
354         (hash_string_insert,hash_string_lookup,removed_prefixes_p)
355         (safer_name_suffix): Moved to paxutils
356
357 2005-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
358
359         * bootstrap (copy_files): Accept optional third argument: a prefix
360         to be appended to destination file names.
361         Import paxutils/paxlib files.
362         * configure.ac: Remove checking for LIB_SETSOCKOPT, it is handled
363         by paxutils.
364         * lib/Makefile.tmpl (libtar_a_SOURCES): Add paxerror.c paxexit.c
365         paxconvert.c
366         * po/POTFILES.in: Likewise.
367         * src/common.h: Remove defines and declarations imported from
368         paxutils
369         * src/misc.c: Likewise
370         * src/list.c (stringify_uintmax_t_backwards): Moved to paxutils
371
372 2005-05-17  Paul Eggert  <eggert@cs.ucla.edu>
373
374         * src/misc.c (remove_any_file): Fix typo in previous change.
375
376 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
377
378         Port to Solaris 10's treatment of unlinking directories.
379         * gnulib-modules: Add unlinkdir.
380         * lib/.cvsignore: Add unlinkdir.h, unlinkdir.c.
381         * src/common.h (we_are_root): Remove extern decl; it's now static.
382         * src/extract.c (we_are_root): Now static.
383         * src/misc.c: Include <unlinkdir.h>.
384         (remove_any_file): Use cannot_unlink_dir () rather than we_are_root.
385
386         * ChangeLog, ChangeLog.1, Makefile.am, NEWS, PORTS, README,
387         README-alpha, TODO, bootstrap, configure.ac, doc/Makefile.am,
388         doc/convtexi.pl, doc/fdl.texi, doc/gendocs_template,
389         lib/Makefile.tmpl, lib/prepargs.c, lib/waitpid.c, po/POTFILES.in,
390         scripts/Makefile.am, scripts/backup-specs, scripts/backup.in,
391         scripts/backup.sh.in, scripts/restore.in, src/Makefile.am,
392         src/arith.h, src/buffer.c, src/common.h, src/compare.c,
393         src/create.c, src/delete.c, src/extract.c, src/incremen.c,
394         src/list.c, src/mangle.c, src/misc.c, src/names.c, src/sparse.c,
395         src/system.c, src/tar.c, src/tar.h, src/update.c, src/utf8.c,
396         src/xheader.c, tests/Makefile.am, tests/append.at,
397         tests/append01.at, tests/comprec.at, tests/delete01.at,
398         tests/delete02.at, tests/delete03.at, tests/delete04.at,
399         tests/delete05.at, tests/extrac01.at, tests/extrac02.at,
400         tests/extrac03.at, tests/extrac04.at, tests/extrac05.at,
401         tests/gzip.at, tests/ignfail.at, tests/incremental.at,
402         tests/link01.at, tests/listed01.at, tests/listed02.at,
403         tests/long01.at, tests/longv7.at, tests/multiv01.at,
404         tests/multiv02.at, tests/multiv03.at, tests/multiv04.at,
405         tests/old.at, tests/options.at, tests/options02.at, tests/pipe.at,
406         tests/recurse.at, tests/same-order01.at, tests/same-order02.at,
407         tests/shortrec.at, tests/sparse01.at, tests/sparse02.at,
408         tests/testsuite.at, tests/truncate.at, tests/version.at,
409         tests/volume.at, tests/star/gtarfail.at, tests/star/gtarfail2.at,
410         tests/star/multi-fail.at, tests/star/pax-big-10g.at,
411         tests/star/quicktest.sh, tests/star/ustar-big-2g.at,
412         tests/star/ustar-big-8g.at:
413         Update FSF postal mail address.
414
415 2005-05-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
416
417         * NEWS: Updated
418         * THANKS: Updated
419         * bootstrap: Install files from paxutils/doc
420         * doc/Makefile.am (tar_TEXINFOS): Add genfile.texi
421         * doc/tar.texi (Genfile): New appendix
422         * src/compare.c (diff_file): diff_handle was not initialized
423         * src/create.c (dump_regular_file): Correctly pad archive members
424         that shrunk during archiving. Repored by Frank Heckenbach.
425         * src/extract.c (file_newer_p): Return false if file does not
426         exist
427         (prepare_to_extract): Correct warning wording.
428         * tests/truncate.at: New test case
429         * tests/Makefile.am: Add truncate.at
430         * tests/testsuite.at: Likewise.
431
432         * doc/.cvsignore: Updated
433         * lib/.cvsignore: Updated
434         * tests/.cvsignore: Updated
435
436 2005-05-02  Paul Eggert  <eggert@cs.ucla.edu>
437
438         * tests/multivol04.at: Tell awk to read from /dev/null.
439
440         Adjust to recent gnulib changes.
441         * lib/.cvsignore: Add dup-safer.c, fd-safer.c, unistd-safer.h.
442         * src/common.h (initial_umask): New var.
443         * src/create.c (start_ueader): Use it, and adjust to new modechange
444         API.
445         (hash_link): unsigned -> size_t parameters and result.
446         * src/incremen.c (hash_directory): Likewise.
447         * src/names.c (hash_string_hasher): Likewise.
448         * src/tar.c (parse_opt): Set it, and adjust to new modechange API.
449
450 2005-04-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
451
452         * tests/Makefile.am: Add shortrec.at.
453
454 2005-04-18  Paul Eggert  <eggert@cs.ucla.edu>
455
456         * src/buffer.c (reading_from_pipe): Remove.  All uses removed.
457         (short_read): Don't warn about short reads; they're normal.
458         * tests/shortrec.at: New file.
459         * tests/testsuite.at: Include it.
460
461         * bootstrap (gnulib_modules): Don't create a file modlist.tmp, as
462         it is sometimes left behind as a garbage file (maybe due to the
463         multiple traps?).
464
465 2005-04-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
466
467         * src/list.c: Handle Solaris 'X' type flag
468         * src/tar.h (SOLARIS_XHDTYPE): New define
469
470 2005-04-06  Sergey Poznyakoff  <gray@mirddin.farlep.net>
471
472         * src/tar.c: Minor fixes to text messages. Proposed by Benno
473         Schulenberg.
474         * src/extract.c: Likewise
475         (extract_file): Assign orig_file_name
476         to save_name uniformly over the program. This fixes matching
477         directory names at the start of an archive volume.
478         * src/buffer.c (flush_write): Warn when the name of the archive
479         straddling volume boundary is longer than 100 characters. Earlier
480         behavior was to issue a fatal error.
481         (struct zip_magic): Reverted part of changes from 2005-04-04.
482         They make the maintenance too costly. Removing `unsigned'
483         qualifier from `magic' member should be enough.
484         * src/compare.c (diff_init): Read directory file if in listed
485         incremental. This prevents spurious 'Contents differ' diagnostics.
486         (diff_archive): Minor fixes to text messages
487         (diff_file,diff_dumpdir,diff_multivol): Assign orig_file_name
488         to save_name uniformly over the program. This fixes matching
489         directory names at the start of an archive volume.
490         * src/create.c: Assign orig_file_name
491         to save_name uniformly over the program. This fixes matching
492         directory names at the start of an archive volume.
493         * src/list.c: Likewise
494
495         * tests/multiv03.at: Modified to match the new behavior
496         * tests/multiv04.at: New file. Test splittind directory members between
497         the archive volumes.
498         * tests/Makefile.am: Add multiv04.at
499         * tests/testsuite.at: Likewise.
500
501 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
502
503         * configure.ac (AC_CONFIG_AUX_DIR): Rename from config to build-aux,
504         for reasons discussed in the thread beginning at
505         <http://lists.gnu.org/archive/html/bug-gnulib/2005-03/msg00119.html>.
506         * .cvsignore: Remove config; add build-aux.
507
508         * src/buffer.c (struct zip_magic): Use char arrays, not pointers.
509         The unsigned char * pointer ran afoul of pedantic C compilers, and
510         we didn't need pointers anyway.  Put the size field before the
511         data to avoid unnecessary padding.  All uses changed.
512         (magic) Make it const, since it doesn't change.  All uses changed.
513
514 2005-04-02  Paul Eggert  <eggert@cs.ucla.edu>
515
516         * src/xheader.c (decode_record): Don't dump core when given
517         a corrupted extended header.  Problem reported by Jim Meyering.
518         Also, check for other ways that the header might be invalid,
519         e.g., missing newline at end.  Do not allow keys with nulls.
520         Allow blanks before and after length, as POSIX requires.
521         Do not allow leading "-" in length.  Check for length overflow.
522         (xheader_decode, xheader_decode_global): Let decode_record
523         check for exhaustion of record.
524         (xheader_read): Null-terminate the extended record;
525         decode_record relies on this.
526
527 2005-03-21  Paul Eggert  <eggert@cs.ucla.edu>
528
529         * bootstrap (TP_URL): Change from
530         <http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
531         <http://www.iro.umontreal.ca/translation/maint/tar/> to avoid
532         some redirection glitches.
533         Use "trap - 0" rather than "trap 0" to fix a POSIX-conformance bug.
534         * doc/.cvsignore: Change "tar.info" to "tar.info*".  Sort.
535         * lib/.cvsignore: Add intprops.h (new gnulib file).
536
537 2005-03-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
538
539         * src/list.c (print_header): Print UID/GID in case of
540         empty user/group name. This could occur when dumping
541         files belonging to non-existing users and when listing
542         broken archives.
543         Reported by Igor Lautar.
544
545         * src/create.c: Correctly parse empty uname/gname
546         * src/sparse.c (sparse_scan_file): Bugfix. offset had
547         incorrect type.
548
549         * scripts/backup.in: Use `head -n 1'. Provide missing
550         argument to ${MT_STATUS}. Proposed by Jan Merka.
551         * scripts/backup.sh.in: Likewise. Fixed typo in
552         MT_OFFLINE assignment.
553         * scripts/restore.in (restore_fs): Use root_fs
554
555 2005-02-15  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
556
557         * src/create.c: Replace strdup with xstrdup
558         * src/names.c: Likewise
559         * src/tar.c: Likewise
560
561         * tests/append01.at: Added reference to bug-tar archive
562         * tests/listed02.at: Use -print with find.
563
564 2005-02-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
565
566         * THANKS: Added Tim Adye. Fixed UTF.
567         * src/list.c (read_header): Removed assignment to
568         oldgnu_header.isextended. It was breaking append mode.
569
570         * tests/append01.at: New test.
571         * tests/Makefile.am: Added append01.at
572         * tests/testsuite.at: Likewise
573
574 2005-02-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
575
576         * gnulib.modules: New file. List of required gnulib
577         modules.
578         * bootstrap: Merge list of required modules from
579         paxutils with that from tar proper.
580         * src/tar.c: Various fixes in help and diagnostic messages.
581
582 2005-02-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
583
584         * src/common.h (EXTRACT_OVER_PIPE): New macro
585         * src/compare.c: Code clean up.
586         * src/extract.c (extract_archive): Do not check for
587         EXTRACT_OVER_PIPE, decode_options() does this.
588         * src/misc.c (exec_error,fork_error,dup2_error)
589         (pipe_error): Removed unneeded functions.
590         * src/system.c (sys_exec_command): Use xclose, xpipe,
591         xfork, xdup2 and exec_fatal.
592         * src/tar.c (options): Improved sorting. Document --backup=off.
593         (decode_options): Clear backup_option if necessary.
594
595 2005-02-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
596
597         Initial implementation of --to-command option proposed
598         by Hansjoerg Lipp.
599
600         * bootstrap: Get setenv module from gnulib
601         * src/buffer.c: Do not use 8-bit chars in comments
602         * src/common.h (to_command_option)
603         (ignore_command_error_option): New globals
604         (sys_exec_command,sys_wait_command): New commands
605         * src/extract.c (extract_file): Handle to_command_option
606         Fix error recovery: decrease `size' by `written', not
607         by `count', otherwise tar misses the next header
608         Do not diagnose write error if to_command_option
609         is set, since the command may have exited prematurely.
610         It would be better to check for sigpipe, though.
611         (prepare_to_extract): Handle to_command_option
612         * src/misc.c (exec_error, fork_error, dup_error)
613         (pipe_error): New functions
614         * src/system.c (sys_exec_command)
615         (sys_wait_command): New functions
616         * src/tar.c: Handle new options --to-command,
617         --ignore-command-error
618         * THANKS: Added Hansjoerg Lipp
619
620 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
621
622         * src/list.c (from_header): New arg OCTAL_ONLY, normally false.
623         All uses changed.  Fix typo that sometimes suppressed all "Archive
624         contains obsolescent base-64 headers" warnings, not just the first
625         one.
626         (tar_checksum): Accept only octal checksums, since they aren't
627         supposed to overflow into weird formats.
628
629         Adjust to gnulib changes.
630         * lib/.cvsignore: Add chdir-long.c, chdir-long.h, memrchr.c,
631         memrchr.h, openat.c, openat.h.  Remove pathmax.h (added by
632         mistake, perhaps?), sysexit.h (my typo), xstrdup.c (gnulib removed
633         this file).  Sort entries.
634
635 2005-02-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
636
637         * src/extract.c: Further rewrite.
638         * src/buffer.c: Removed unused variables.
639         * src/list.c: Likewise
640         * src/tar.c (update_argv): Changed type to void
641
642         * src/common.h (OLDGNU_NAME_FIELD_SIZE): New constant
643         * src/create.c (start_private_header,write_header_name)
644         (dump_hard_link): Restore compatibility with 1.13.25
645         * src/extract.c (extract_archive): Rewritten
646         * src/list.c: Add translators' comments
647         * src/tar.c (options) Minor spelling fix
648         * tests/star/quicktest.sh: Determine path to the tar executable.
649
650 2005-02-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
651
652         * po/POTFILES.in: Added tests/genfile.c
653         * src/buffer.c (short_read): Use ngettext()
654         (new_volume): use quote().
655         * src/create.c: Use quote()
656         * src/extract.c: Likewise
657         * src/xheader.c: Likewise
658         * src/misc.c: Add comments to translators
659
660         * tests/same-order01.at: sort ls output
661         * tests/sparse01.at (RE_CHECK): Added missing space
662
663         * tests/sparse02.at: Test extracting sparse files over a pipe.
664         * tests/Makefile.am: Added sparse02.at
665         * tests/testsuite.at: Likewise
666         * tests/listed02.at: Skip the test on filesystems that do not
667         update ctime of a file when renaming it. To be reverted when
668         the new incremental mode is ready.
669         * tests/sparse01.at: Extract and compare sparse file
670
671 2005-02-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
672
673         * src/sparse.c: Extract sparse files even if the output
674         fd is not seekable.
675
676 2005-02-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
677
678         * bootstrap: Add a comment to lib/Makefile.am saying that this
679         is an autogenerated file.
680         Exit with code 1 if any of autotools fails.
681         * lib/Makefile.tmpl: Insert Emacs magic to the first line.
682         * tests/Makefile.am: Add append.at
683
684         * m4/.cvsignore: Ignore all *.m4 files
685
686 2005-01-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
687
688         Rewritten handling of -T (--files-from) option. Now it
689         inserts the file names immediately into argv array which allows
690         for:
691         1) any valid tar options (including another -T) to be used in the file
692         2) any number of -T options to be given in command line
693
694         * configure.ac: Raised version number to 1.15.2
695         * src/common.h: Include obstack.h
696         (files_from_option): Removed
697         (unquote_option): New variable
698         (stat_fatal): New function
699         (name_close): Removed function.
700         * src/incremen.c: Remove inclusion of obstack.h
701         * src/xheader.c: Likewise.
702         * src/misc.c (stat_fatal): New function
703         * src/names.c (name_file): Removed variable.
704         (read_name_from_file): Removed function. All callers changed.
705         (name_close): Removed function. All callers changed.
706         * src/tar.c: New options --unquote (--no-unquote) and
707         --add-file
708         (add_file_id,read_name_from_file,update_argv): New functions
709         (parse_opt): Rewritten handling of -T option. Handle hidden
710         --HANG option for debugging purposes.
711         (decode_options): Init unquote_option to true. Init argv_stk.
712         Remove unneeded references to files_from_option
713
714         * doc/tar.texi: Document new options.
715         Moved rendition macros and option value definitions into
716         separate files
717         * doc/rendition.texi: New file
718         * doc/value.texi: New file
719         * doc/Makefile.am: Updated
720
721 2005-01-13  Paul Eggert  <eggert@cs.ucla.edu>
722
723         * tests/testsuite.at (RE_CHECK): Use "join - file", not
724         "join file -", to work around a bug in Solaris 8 join.
725         Problem reported by Tomohiro Suzuki.
726
727 2005-01-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
728
729         * src/list.c (read_header): Fixed calculation of the
730         size for GNU long name/link. Tar was reading one block
731         more if name_size was divisible by 512. Thanks Josef
732         Bauer.
733         * tests/long01.at: New file. Test listing of GNU long names
734         divisible by 512.
735         * tests/pipe.at: Sort tar output.
736         * tests/Makefile.am: Added long01.at
737         * tests/testsuite.at: Likewise.
738         * THANKS: Added Josef Bauer
739         * lib/.cvsignore: Updated
740         * m4/.cvsignore: Updated
741         * NEWS: Updated
742
743 2005-01-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
744
745         * directory: Updated for 1.15.1
746         * doc/Makefile.am: Use gendocs.sh to generate web documentation
747         * doc/gendocs_template: Template file for gendocs.sh
748         * doc/tar.texi: Updated docs for --[no-]same-permissions
749         * src/tar.c: Reworded docstrings for --[no-]same-permissions
750
751 2005-01-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
752
753         * bootstrap: Create m4/paxutils.m4
754         * configure.ac: Call tar_PAXUTILS
755         * tests/options02.at: Test that tar correctly handles non-option
756         arguments interspersed with options.
757         * tests/Makefile.am: Add options02.at
758         * tests/testsuite.at: Likewise
759         * tests/listed02.at: Do not create useless directory
760
761 2005-01-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
762
763         * src/tar.c (parse_opt): Bugfix: Use ARGP_KEY_ARG. Thanks
764         Mike Frysinger <vapier@gentoo.org> for reporting.
765
766 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
767
768         * lib/Makefile.tmpl (localedir.h): Omit needless quotes and a
769         needless sed command.  Problem reported by Paul Jarc.
770
771 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
772
773         Accommodate latest gnulib.
774         * doc/.cvsignore: Add getdate.texi.
775         * bootstrap: Do not treat alloca-opt specially; this is no
776         longer needed (and breaks builds) with latest gnulib.
777
778 2004-12-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
779
780         * src/tar.c (main): Reverted recent changes (#ifdef).
781
782 2004-12-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
783
784         * configure.ac: Raise version number to 1.15.1
785         Check for locale.h
786         * NEWS: Entry for 1.15.1
787         * src/buffer.c: Bugfix. Changes introduced 2004-11-26
788         broke extraction from stdin.
789         * src/list.c (from_header, tar_checksum): Changed declaration.
790         All callers updated.
791         * src/common.h: Likewise
792         * src/tar.c (main): Protect invocation of setlocale by
793         ifdef.
794
795         * tests/comprec.at: New test
796         * tests/pipe.at: New test
797         * tests/Makefile.am (comprec.at,pipe.at): New tests
798         * tests/testsuite.at: Likewise
799         * tests/gzip.at: Use AT_GZIP_PREREQ
800         * tests/star/pax-big-10g.at: Likewise
801         * tests/star/ustar-big-2g.at: Likewise
802         * tests/star/ustar-big-8g.at: Likewise
803
804         * tests/extrac04.at: Discard stderr from sort, on some
805         systems it spits out lots of irrelevant info.
806         * tests/listed02.at: Likewise
807
808         * doc/index.html.in: Rewritten in xhtml to follow recent
809         GNU site standards.
810         * THANKS: Updated
811
812 2004-12-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
813
814         Released version 1.15. Sources up to this point are
815         tagged release_1_15.
816
817         * configure.ac: Raised version number to 1.15
818         * NEWS: Likewise
819         * directory: Updated
820         * bootstrap (update_po): Give -r to wget. Always remove index.html
821         Ignore alloca-opt module (it duplicates alloca)
822
823         * tests/Makefile.am: Distribute star/quicktest.sh
824         * tests/star/README: Document quicktest.sh
825         * tests/star/qucktest.sh: Removed.
826         * tests/star/quicktest.sh: New file.
827
828 2004-12-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
829
830         * NEWS: Updated
831         * doc/tar.texi: Document auto-detection of compressed archive
832         formats.
833         * src/tar.c (decode_options): Ignore --seek if used with --delete.
834         Delete.c is based on the assumption that the archive is being
835         actually read, not lseeked.
836
837         * tests/delete05.at: New file
838         * tests/extrac02.at: Fixed typo in AT_SETUP
839         * tests/Makefile.am: Added delete05.at
840         * tests/testsuite.at: Likewise.
841
842 2004-12-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
843
844         * src/delete.c (delete_archive_members): Bugfix: when
845         attempting to delete an nonexistent member, the last
846         blocking_factor blocks were zeroed.
847
848 2004-12-14  Paul Eggert  <eggert@cs.ucla.edu>
849
850         * TODO: Mention sub-second resolution, lutimes, lchmod.
851
852 2004-11-27  Paul Eggert  <eggert@cs.ucla.edu>
853
854         Adjust to recent gnulib changes.
855         * doc/getdate.texi: Remove, since bootstrap gets it from gnulib now.
856         * .cvsignore: Add rmt, rmt/*, rmt/*/*.
857         * lib/.cvsignore: Add allocsa.c, allocsa.h, allocsa.valgrind,
858         charset.alias, config.charset, getcwd.c, getcwd.h, localcharset.c,
859         localcharset.h, ref-add.sed, ref-add.sin, ref-del.sed,
860         ref-del.sin, setenv.c, setenv.h, unsetenv.c.  Remove pathmax.h,
861         xstrdup.c.
862         * m4/.cvsignore: Add allocsa.m4, eealloc.m4, getcwd-path-max.m4,
863         localcharset.m4, realloc.m4, setenv.m4.  Remove malloc.m4,
864         pathmax.m4, realloc.m4.
865
866 2004-11-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
867
868         * configure.ac: Raised version number to 1.14.91
869         * scripts/tarcat: New file
870         * scripts/Makefile.am: Added tarcat
871         * src/buffer.c (hit_eof): Changed type to boolean
872         (read_full_records,reading_from_pipe): New variables
873         (check_compressed_archive,open_compressed_archive): New functions
874         (open_archive): Autodetect compressed archives and act accordingly.
875         Set reading_from_pipe. This fixes controversial set of changes
876         introduced 2004-05-11,2004-03-22.
877         * src/list.c (tar_checksum): New function
878         (read_header): Use tar_checksum().
879         * src/common.h (tar_checksum): New function
880
881         * tests/star/README: Updated
882         * NEWS: Updated
883         * PORTS: Updated
884
885 2004-11-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
886
887         * src/tar.c (decode_options): Fixed -o semantics. Thanks
888         Jean Delvare <khali@linux-fr.org>
889
890 2004-10-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
891
892         * bootstrap: Add localcharset
893         * lib/Makefile.tmpl: Initialize SUFFIXES and CLEANFILES since the
894         makefile snippet from localcharset uses '+=' on them.
895         * src/Makefile.am (LDADD): Add LIBICONV
896         * src/list.c (decode_header): Set uname/gname to NULL if their
897         header counterparts are empty
898         * src/tar.c (options): Use OPTION_NO_TRANS
899         * src/utf8.c: Use locale_charset() from gnulib
900
901         * tests/star/README: Updated
902
903         * NEWS: Updated
904         * TODO: Minor fix
905
906 2004-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
907
908         * THANKS: Added Bryan Ford
909         * doc/Makefile.am (.text): Fixed rule
910         * po/POTFILES.in: Added argp-help.c
911
912 2004-10-04  Bryan Ford  <baford@mit.edu>
913
914         * src/tar.c: New option --exclude-caches, to exclude
915         cache directories automatically on archive creation.
916         Cache directories are directories containing a
917         standardized tag file, as specified at:
918                 http://www.brynosaurus.com/cachedir/spec.html
919         * src/common.h: New variable exclude_caches_option.
920         * src/create.c: New function check_cache_directory(),
921         called from dump_dir0() if exclude_caches_option is set,
922         to check for a cache directory tag and exclude the directory
923         if such a tag is found.
924         * doc/tar.texi: Updated accordingly.
925
926 2004-09-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
927
928         * doc/tar.texi: Minor fix
929         * src/tar.c (options): Minor fix
930
931 2004-09-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
932
933         * TODO: Updated
934         * lib/Makefile.tmpl: Added 'rtapelib.o: localedir.h' dependency
935         * src/common.h: Comment WANT_DIRECTORY_REMOVE_OPTION.
936         * src/extract.c: Normalized use of remove_any_file().
937         * src/misc.c: Likewise.
938         * src/tar.c (parse_opt): Emit warning if -l option is used.
939         (show_default_settings): REMOTE_SHELL may be undefined
940
941 2004-09-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
942
943         Test suite rewritten in autotest.
944
945         * configure.ac: Updated for autotest
946         * src/tar.c (argp_program_version): Modified.
947         * tests/Makefile.am: Rewritten for autotest.
948
949         * tests/.cvsignore: Updated
950         * tests/append.at: New file
951         * tests/atlocal.in: New file
952         * tests/delete01.at: New file
953         * tests/delete02.at: New file
954         * tests/delete03.at: New file
955         * tests/delete04.at: New file
956         * tests/extrac01.at: New file
957         * tests/extrac02.at: New file
958         * tests/extrac03.at: New file
959         * tests/extrac04.at: New file
960         * tests/extrac05.at: New file
961         * tests/gzip.at: New file
962         * tests/ignfail.at: New file
963         * tests/incremental.at: New file
964         * tests/link01.at: New file
965         * tests/listed01.at: New file
966         * tests/listed02.at: New file
967         * tests/longv7.at: New file
968         * tests/multiv01.at: New file
969         * tests/multiv02.at: New file
970         * tests/multiv03.at: New file
971         * tests/old.at: New file
972         * tests/options.at: New file
973         * tests/recurse.at: New file
974         * tests/same-order01.at: New file
975         * tests/same-order02.at: New file
976         * tests/sparse01.at: New file
977         * tests/testsuite.at: New file
978         * tests/version.at: New file
979         * tests/volume.at: New file
980         * tests/star/gtarfail.at: New file
981         * tests/star/gtarfail2.at: New file
982         * tests/star/multi-fail.at: New file
983         * tests/star/pax-big-10g.at: New file
984         * tests/star/ustar-big-2g.at: New file
985         * tests/star/ustar-big-8g.at: New file
986
987         * tests/preset.in: Removed
988         * tests/before: Removed
989         * tests/after: Removed
990         * tests/version.sh: Removed.
991         * tests/append.sh: Removed.
992         * tests/delete01.sh: Removed.
993         * tests/delete02.sh: Removed.
994         * tests/delete03.sh: Removed.
995         * tests/delete04.sh: Removed.
996         * tests/extrac01.sh: Removed.
997         * tests/extrac02.sh: Removed.
998         * tests/extrac03.sh: Removed.
999         * tests/extrac04.sh: Removed.
1000         * tests/extrac05.sh: Removed.
1001         * tests/gzip.sh: Removed.
1002         * tests/incremen.sh: Removed.
1003         * tests/ignfail.sh: Removed.
1004         * tests/link01.sh: Removed.
1005         * tests/listed01.sh: Removed.
1006         * tests/listed02.sh: Removed.
1007         * tests/longv7.sh: Removed.
1008         * tests/multiv01.sh: Removed.
1009         * tests/multiv02.sh: Removed.
1010         * tests/multiv03.sh: Removed.
1011         * tests/old.sh: Removed.
1012         * tests/options.sh: Removed.
1013         * tests/same-order01.sh: Removed.
1014         * tests/same-order02.sh: Removed.
1015         * tests/volume.sh: Removed.
1016         * tests/recurse.sh: Removed.
1017         * tests/sparse01.sh: Removed.
1018         * tests/star/gtarfail.sh: Removed.
1019         * tests/star/gtarfail2.sh: Removed.
1020         * tests/star/multi-fail.sh: Removed.
1021         * tests/star/ustar-big-2g.sh: Removed.
1022         * tests/star/ustar-big-8g.sh: Removed.
1023         * tests/star/pax-big-10g.sh: Removed.
1024
1025 2004-09-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1026
1027         * bootstrap: Install genfile.c from paxutils
1028         * tests/genfile.c: Removed. Integrated into
1029         paxutils.
1030         * tests/mksparse.c: Removed. Integrated into
1031         (paxutils) genfile.c
1032         * tests/Makefile.am: Removed mksparse
1033         * tests/sparse01.sh: Use genfile instead of mksparse
1034
1035 2004-09-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1036
1037         Started merging with cpio into paxutils. Sources before
1038         this point are tagged alpha-1_14_90
1039
1040         * Makefile.am: Updated for use with paxutils
1041         * README-alpha: Likewise
1042         * bootstrap: Likewise
1043         * configure.ac: Likewise
1044         * lib/Makefile.tmpl: Likewise
1045         * po/POTFILES.in: Likewise
1046         * src/Makefile.am: Likewise
1047         * src/buffer.c: Likewise
1048         * src/common.h: Likewise
1049         * src/compare.c: Likewise
1050         * src/create.c: Likewise
1051         * src/delete.c: Likewise
1052         * src/extract.c: Likewise
1053         * src/incremen.c: Likewise
1054         * src/list.c: Likewise
1055         * src/mangle.c: Likewise
1056         * src/misc.c: Likewise
1057         * src/names.c: Likewise
1058         * src/sparse.c: Likewise
1059         * src/system.c: Likewise
1060         * src/tar.c: Likewise
1061         * src/update.c: Likewise
1062         * src/utf8.c: Likewise
1063         * src/xheader.c: Likewise
1064
1065         * src/system.h: Removed
1066         * src/rmt.c: Removed
1067         * src/rmt.h: Removed
1068         * src/rtapelib.c: Removed
1069
1070 2004-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1071
1072         * tests/listed02.sh: Do not depend on any particular ordering
1073         of output.
1074
1075 2004-09-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1076
1077         * doc/tar.texi: Document the use of -C option in
1078         file lists. Document --seek option.
1079         * configure.ac: New option --with-rmt. New configuration variable
1080         DEFAULT_RMT_DIR. Removed DEFAULT_RMT_COMMAND.
1081         * src/Makefile.am: Install rmt into rmtdir
1082         * src/tar.c (usage): Minor fix.
1083         * NEWS: Updated.
1084         * README: Updated.
1085
1086 2004-09-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1087
1088         * configure.ac: Raised version number to 1.14.90
1089         * src/common.h (is_individual_file): New prototype
1090         * src/create.c (dump_file0): Fix bug introduced
1091         2004-02-21.
1092         * src/names.c (register_individual_file)
1093         (is_individual_file): New functions.
1094         * tests/listed01.sh: Use genfile instead of dd.
1095         * tests/listed02.sh: New file.
1096         * tests/Makefile.am: Added listed02.sh
1097
1098         * NEWS: Updated
1099
1100 2004-08-31  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1101
1102         * src/sparse.c (sparse_add_map): Fixed improper initializations
1103         of sparse_map_size. We assume that whatever number it contains
1104         describes adequately the current size of sparse_map. The only
1105         number we need to reset is sparse_map_avail.
1106         * src/compare.c (verify_volume): Call set_next_block_after
1107         if read_header returns HEADER_FAILURE
1108         Destroy and reinitialize content of current_stat_info and
1109         extended_header after each iteration (bug reported by
1110         John L. Males <jlmales@yahoo.com>).
1111         Issue a warning if the created archive contains some members
1112         whose file names were stripped off their leading prefixes.
1113         This is a temporary fix of the issue reported by Bdale Garbee
1114         <bdale@gag.com> (Refs: Debian bug 230064, Message-Id
1115         <87n07kyzhi.fsf@rover.gag.com>, Sun, 15 Feb 2004 11:22:17 -0700)
1116
1117         * src/names.c (removed_prefixes_p): New function.
1118
1119         * src/buffer.c: When computing write rate do not take
1120         into account the time needed to verify the archive(s).
1121         The bug reported by John L. Males <jlmales@yahoo.com>
1122         (set_start_time,compute_duration): New functions.
1123         (print_total_written): Use the result of compute_duration().
1124         (close_archive): Call compute_duration.
1125         * src/common.h (set_start_time, removed_prefixes_p): New prototypes.
1126         * src/list.c (decode_header): Fixed initialization
1127         of stat_info->is_sparse
1128         * src/tar.c (main): Call set_start_time().
1129
1130         * src/misc.c (unquote_string): Unquote '\a' and '\v'.
1131         Reported by Helmut Waitzmann <helmut.waitzmann@web.de>.
1132
1133         * NEWS: Updated
1134         * THANKS: Updated
1135
1136 2004-08-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1137
1138         * src/tar.c: Fix copy-n-paste errors in the license
1139
1140 2004-08-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1141
1142         * scripts/backup.in: Renamed LIBPATH to LIBDIR.
1143         Use ROOT_FS with -C option. Do not send mail
1144         if ADMINISTRATOR is set to NONE.
1145         * scripts/backup.sh.in (test_root): Append / to
1146         ROOT_FS if it does not already end in it.
1147         * scripts/restore.in: Renamed LIBPATH to LIBDIR.
1148         New option -a (--all). Do not start restore unless
1149         -a or patterns are given.
1150         (restore_fs,restore_files): Fixed use of --listed option.
1151         * doc/tar.texi: Updated
1152         * NEWS: Updated
1153
1154 2004-08-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1155
1156         * src/tar.c (find_argp_option): Fixed typo
1157
1158 2004-08-12  Paul Eggert  <eggert@cs.ucla.edu>
1159
1160         Merge argp, getopt, xalloc changes from gnulib.
1161         * bootstrap (gnulib_modules): Add xalloc-die.
1162         Remove code to test for patches; we don't have patches now.
1163         Set LC_ALL=C so that file names sort consistently.
1164         Prefer the gnulib copies of gettext.m4, glibc21.m4,
1165         lib-ld.m4, lib-prefix.m4, po.m4 too.
1166
1167         * patches/getopt.diff: Remove; gnulib now works unpatched.
1168         * configure.ac (_getopt_long_only_r): Remove check.
1169         gl_ARGP now does this for us.
1170         * lib/.cvsignore: Add fnmatch.h, getopt_.h, sysexit.h,
1171         xalloc-die.c.
1172         * src/extract.c: Adjust to changes to gnulib xalloc module.
1173         (extr_init): Remove assignment to xalloc_fail_func; no longer needed.
1174         (xalloc_die): New function.
1175
1176 2004-08-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1177
1178         * NEWS: Updated
1179
1180         * src/buffer.c (flush_write): Limit filenames
1181         of the members that straddle multivolume archive
1182         boundary to 100 characters.
1183         (flush_read): Use strncmp when comparing multivolume member
1184         names.
1185         * tests/multiv03.sh: New file
1186         * tests/Makefile.am: Added multiv03.sh
1187
1188 2004-08-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1189
1190         * src/list.c (read_and): Call decode_header before
1191         calling skip_member()
1192         (skip_member): Use is_sparse field to determine if the
1193         member is a sparse file.
1194
1195         * tests/Makefile.am: Added extrac05.sh
1196         * tests/extrac05.sh: New file
1197         * tests/append.sh: Rearranged leading comments. Added explicit
1198         references to report messages wherever available.
1199         * tests/delete01.sh: Likewise
1200         * tests/delete02.sh: Likewise
1201         * tests/delete03.sh: Likewise
1202         * tests/delete04.sh: Likewise
1203         * tests/extrac01.sh: Likewise
1204         * tests/extrac02.sh: Likewise
1205         * tests/extrac03.sh: Likewise
1206         * tests/extrac04.sh: Likewise
1207         * tests/gzip.sh: Likewise
1208         * tests/ignfail.sh: Likewise
1209         * tests/incremen.sh: Likewise
1210         * tests/link01.sh: Likewise
1211         * tests/listed01.sh: Likewise
1212         * tests/longv7.sh: Likewise
1213         * tests/multiv01.sh: Likewise
1214         * tests/multiv02.sh: Likewise
1215         * tests/old.sh: Likewise
1216         * tests/options.sh: Likewise
1217         * tests/recurse.sh: Likewise
1218         * tests/same-order01.sh: Likewise
1219         * tests/same-order02.sh: Likewise
1220         * tests/sparse01.sh: Likewise
1221         * tests/version.sh: Likewise
1222         * tests/volume.sh: Likewise
1223
1224 2004-08-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1225
1226         * bootstrap: Extended --update-po option to take an
1227         optional argument specifying the po file to update.
1228         * src/create.c: Improved compatibility with 1.13.25
1229         * tests/link01.sh: New file.
1230         * tests/Makefile.am: Added link01.sh
1231
1232 2004-08-06  Paul Eggert  <eggert@cs.ucla.edu>
1233
1234         Merge from gnulib.
1235
1236         * patches/argp.diff: Remove; no longer needed.
1237
1238         * lib/.cvsignore: Add stat-macros.h.
1239         Remove addext.c, malloc.c, realloc.c.
1240
1241         * src/extract.c: Include <getcwd.h>.
1242         (extract_archive): Rewrite with new macro IS_ABSOLUTE_FILE_NAME.
1243         * src/extract.c (make_directories):
1244         FILESYSTEM_PREFIX_LEN -> FILE_SYSTEM_PREFIX_LEN.
1245         * src/misc.c (must_be_dot_or_slash): Likewise.
1246         * src/names.c (excluded_name, safer_name_suffix, stripped_prefix_len):
1247         Likewise.
1248         * src/tar.c (parse_opt): Likewise.
1249         * src/incremen.c (purge_directory): Fix format buffer typos in warning
1250         strings.
1251         * src/tar.c (options): Add missing initializers to pacify gcc.
1252         (decode_options): Remove unused var.
1253
1254 2004-08-02  Paul Eggert  <eggert@cs.ucla.edu>
1255
1256         * bootstrap (gnulib_modules): Add getpagesize.
1257         * configure.ac (valloc): Remove check; valloc no longer used.
1258         * lib/.cvsignore: Add getpagesize.h.
1259         * m4/.cvsignore: Add getpagesize.m4.
1260         * src/buffer.c (record_buffer): New var.
1261         (open_archive): Don't use valloc; on older or buggy hosts, you can't
1262         free the result.  Use page_aligned_alloc instead.
1263         * src/compare.c (diff_init): Likewise.
1264         * src/buffer.c (open_archive): Record the pointer to be freed
1265         into record_buffer.
1266         (close_archive): Free record_buffer.
1267         * src/common.h (page_aligned_alloc): New decl.
1268         * src/misc.c (quote_n, quote): Remove these redundant functions.
1269         (ptr_align): New function, from coreutils/src/system.h.
1270         (page_aligned_alloc): New function.
1271         * src/system.h (valloc): Remove.
1272
1273 2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
1274
1275         * src/extract.c (extract_archive): Do not report an error
1276         when hard-linking X to X when X exists.  Problem reported by
1277         Toby Peterson.
1278         * lib/.cvsignore: Add fchown-stub.c.
1279
1280 2004-06-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1281
1282         * NEWS: Updated
1283         * src/common.h (root_device): New global.
1284         (gnu_restore): Renamed to purge_directory().
1285         * src/extract.c (extr_init): Save the device number
1286         of the root device.
1287         (extract_archive): Renamed gnu_restore() to purge_directory().
1288         * src/incremen.c (gnu_restore): Renamed to purge_directory().
1289         Do not attempt to purge the directory if it is on a different
1290         device and one_file_system_option is set.
1291
1292 2004-06-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1293
1294         * doc/tar.texi: The actual default for exclude patterns
1295         is --no-anchored. Fixed.
1296         * src/tar.c (options): Likewise.
1297         Thanks "Felix Natter" <felix.natter@ldc.de> for noticing.
1298
1299 2004-06-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1300
1301         * doc/tar.texi: Fixed several inconsistencies.
1302         * src/tar.c: Fixed docstring for --checkpoint option.
1303
1304 2004-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1305
1306         * src/buffer.c (seek_archive): New function
1307         * src/common.h (seek_archive): New function
1308         (seekable_archive): New global.
1309         * src/list.c (skip_file): Use seek_archive() if
1310         possible.
1311         * src/tar.c (struct fmttab): Accept 'pax' as alias
1312         for 'posix'
1313         (options): New option -n (--seek).
1314         * src/update.c: Determine type of the archive before
1315         appending to it.
1316
1317         * TODO: Updated.
1318
1319 2004-05-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1320
1321         * bootstrap: New option --update-po
1322         * src/tar.c: New option -H (short alias to --format)
1323         * doc/tar.texi: Document -H option
1324         * src/names.c (safer_name_suffix): Fixed bug introduced
1325         2004-05-11.
1326
1327 2004-05-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1328
1329         * bootstrap: Apply patches from patch subdirectory
1330         * patches: New dir
1331         * patches/argp.diff: New file
1332         * patches/getopt.diff: New file
1333         * configure.ac: Check for _getopt_long_only_r and
1334         force using included version of getopt if the function
1335         is not available.
1336         * src/tar.c: Use argp for command line parsing.
1337         * src/system.h: Minor formatting fix
1338         * m4/.cvsignore: Updated
1339         * lib/.cvsignore: Updated
1340         * doc/tar.texi: Minor fix.
1341         * src/extract.c: Fix improper use of 'path' term
1342         * src/incremen.c: Likewise
1343         * src/list.c: Likewise
1344         * src/misc.c: Likewise
1345         * src/names.c: Likewise
1346         * src/rmt.h: Likewise
1347         * src/rtapelib.c: Likewise
1348         * src/update.c: Likewise
1349         * src/xheader.c: Likewise
1350         * tests/star/README: Minor fix
1351
1352 2004-05-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1353
1354         * configure.ac: Raised version number to 1.14.1
1355         * src/tar.c: Renamed --strip-path to --strip-components
1356         Changed improper use of _() to ngettext().
1357         * src/extract.c: Renamed strip_path_option to strip_components_option
1358         * src/common.h: Likewise.
1359         * NEWS: Updated.
1360         * doc/tar.texi: Updated
1361
1362 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1363
1364         * src/system.c (sys_child_open_for_uncompress): Do not
1365         set read_full_records_option: the compressed archive is
1366         likely not to contain integer number of records. Should
1367         the user wish to use reblocking, he may always give tar
1368         -B option. This is a minor improvement over the change
1369         dated 2004-03-22.
1370         * src/buffer.c (open_archive): Removed assignment to
1371         read_full_records_option.
1372
1373         * src/names.c (safer_name_suffix): (safer_name_suffix): Use "%s"
1374         as the format argument, rather than a possibly-translated variable
1375         string. Patch provided by Jim Meyering  <jim@meyering.net>
1376         * src/tar.c (decode_options): Fixed typo in the comment.
1377         * tests/star/README: Minor correction
1378
1379 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1380
1381         * directory: New file. GNU directory entry for tar.
1382         * doc/Makefile.am: Rewritten. Added rules for generating
1383         documentation for the project's website.
1384         * doc/.cvsignore: Updated
1385         * doc/index.html.in: New file.
1386
1387 2004-05-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1388
1389         * configure.ac: Raised version number to 1.14
1390         * NEWS: Updated.
1391         * tests/after: Added copyleft statement
1392         * tests/before: Added copyleft statement
1393         * tests/preset.in: Added copyleft statement
1394
1395         Tar 1.14 is released. Sources up to this point are tagged
1396         release_1_14
1397
1398 2004-05-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1399
1400         * configure.ac: Fixed prerequisite headers for sys/buf.h
1401         (needed on FreeBSD)
1402         * src/system.h: Likewise.
1403         * tests/after (compare): Fixed argument quoting under eval
1404         * tests/before: Quote TAR_ARCHIVE_FORMATS
1405
1406 2004-05-10  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1407
1408         * NEWS: Updated
1409         * README: Updated
1410         * PORTS: Updated
1411         * configure.ac: Call gl_AC_TYPE_INTMAX_T. Document
1412         DEFAULT_.* variables. Use DEFAULT_RMT_COMMAND to set
1413         the pathname of the rmt utility.
1414         New option --enable-backup-scripts.
1415         * doc/tar.texi: Updated
1416         * scripts/Makefile.am: Install the scripts only if requested
1417         by the configure.
1418         * scripts/backup.in: Fixed --version output.
1419         Fixed initialization of the listing files and printing
1420         the time of the last previous level dump.
1421         * scripts/restore.in: Fixed --version output.
1422         * src/Makefile.am (localedir.h rule): Generate correct
1423         DEFAULT_RMT_COMMAND variable.
1424         * src/common.h (rmt_command_option): New variable.
1425         * src/list.c (read_and): Print block number before
1426         issuing 'Skipping to next header' diagnostics, if
1427         requested by block_number_option.
1428         * src/rtapelib.c: Use rmt_command_option instead of
1429         hardcoded "/etc/rmt".
1430         * src/tar.c: New option --rmt-command.
1431         (decode_options): Handle --rmt-command. Initialize
1432         rmt_command_option to DEFAULT_RMT_COMMAND.
1433
1434 2004-05-09  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1435
1436         * doc/tar.texi: Further update.
1437
1438 2004-05-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1439
1440         * configure.ac: Minor fix
1441         * scripts/Makefile.am: Updated
1442         * scripts/backup-specs: Updated
1443         * scripts/backup.in: Minor fixes
1444         * scripts/backup.sh: Removed
1445         * scripts/backup.sh.in: New file. Source for backup.sh
1446         * scripts/restore.in: New file
1447         * scripts/.cvsignore: Updated
1448         * scripts/WARNING: Removed
1449         * doc/tar.texi: Updated
1450         * NEWS: Updated
1451
1452 2004-05-07  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1453
1454         * src/names.c (name_gather): Bugfix: Honor single -C with
1455         --same-order.
1456         * tests/same-order01.sh: New file
1457         * tests/same-order02.sh: New file
1458         * tests/Makefile.am: Updated
1459
1460         * tests/append.sh: Added copyleft header
1461         * tests/delete01.sh: Likewise
1462         * tests/delete02.sh: Likewise
1463         * tests/delete04.sh: Likewise
1464         * tests/extrac01.sh: Likewise
1465         * tests/extrac02.sh: Likewise
1466         * tests/extrac03.sh: Likewise
1467         * tests/extrac04.sh: Likewise
1468         * tests/gzip.sh: Likewise
1469         * tests/ignfail.sh: Likewise
1470         * tests/incremen.sh: Likewise
1471         * tests/multiv01.sh: Likewise
1472         * tests/old.sh: Likewise
1473         * tests/options.sh: Likewise
1474         * tests/recurse.sh: Likewise
1475         * tests/version.sh: Likewise
1476         * tests/volume.sh: Likewise
1477         * tests/star/gtarfail.sh: Likewise
1478         * tests/star/gtarfail2.sh: Likewise
1479         * tests/star/multi-fail.sh: Likewise
1480         * tests/star/pax-big-10g.sh: Likewise
1481         * tests/star/qucktest.sh: Likewise
1482         * tests/star/ustar-big-2g.sh: Likewise
1483         * tests/star/ustar-big-8g.sh: Likewise
1484
1485         * doc/.cvsignore: Updated
1486
1487 2004-05-06  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1488
1489         * configure.ac: Check whether date accepts +format argument
1490         (for backup scripts).
1491         * scripts/level-0: Removed
1492         * scripts/level-1: Removed
1493         * scripts/weekly.new: Removed
1494         * scripts/dump-remind: Removed
1495         * scripts/backup.in: New file
1496         * scripts/backup.sh: New file
1497         * scripts/dump-remind.in: New file
1498         * scripts/backup-specs: Updated
1499         * scripts/Makefile.am: Updated for new directory contents.
1500         * scripts/.cvsignore: Updated
1501
1502 2004-05-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1503
1504         * TODO: Updated
1505         * doc/tar.texi: Updated
1506         * src/tar.c: --utc implies -vv
1507
1508 2004-04-28  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1509
1510         * src/utf8.c: Make sure ICONV_CONST is defined. AM_ICONV
1511         does not define it if it fails to find iconv.h.
1512
1513 2004-04-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1514
1515         * bootstrap: Use gnulib-tool to generate lib/Makefile.am
1516         and parts of configure.ac
1517         * configure.ac: Invoke tar_GNULIB to configure gnulib stuff.
1518         * lib/Makefile.am: Removed
1519         * lib/Makefile.tmpl: New file.
1520         * lib/.cvsignore: Updated
1521         * m4/.cvsignore: Updated
1522         * src/xheader.c: Include stpcpy.h
1523
1524         * src/create.c: Produce an error, not warning, if the
1525         filename is too long.
1526         * tests/longv7.sh: Synchronized with the recent changes.
1527
1528 2004-04-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1529
1530         * configure.ac: Fixed test for iconv_t
1531         * src/rmt.h: Bugfix by Jürgen Weigert
1532         * THANKS: Add Jürgen Weigert
1533         * tests/star/README: Fixed typo
1534
1535 2004-04-04  Paul Eggert  <eggert@twinsun.com>
1536
1537         Merge getdate documentation changes from coreutils.
1538
1539         * doc/getdate.texi: Update from coreutils CVS.
1540         * doc/tar.texi: Fix getdate menu to match getdate.texi's.
1541
1542         Merge recent gnulib changes, and remove some lint.
1543
1544         Improve support for nanosecond-resolution time stamps.
1545         * bootstrap: Add gettime, timespec modules.
1546         * configure.ac (gl_GETTIME, gl_TIMESPEC): Add.
1547         * lib/.cvsignore (getopt_int.h, gettime.c, gettimeofday.c,
1548         timespec.h): Add.
1549         * lib/Makefile.am (libtar_a_SOURCES): Add gettime.c, timespec.h.
1550         * m4/.cvsignore: Add clock_time.m4, gettime.m4, gettimeofday.m4,
1551         st_mtim.m4, timespec.m4.  Remove malloc.m4, realloc.m4.
1552         * src/common.h (newer_mtime_option): Now a struct timespec, not
1553         time_t.  All uses changed.
1554         (NEWER_OPTION_INITIALIZED, OLDER_STAT_MTIME): New macros.
1555         * src/create.c (dump_file0): Use OLDER_STAT_TIME to compare times.
1556         * src/incremen.c (scan_path): Likewise.
1557         * src/list.c (read_and): Likewise.
1558         * src/list.c (read_and): Use NEWER_OPTION_INITIALIZED to decide
1559         whether newer_mtime_option is initialized.
1560         * src/tar.c (decode_options): Likewise.
1561         * src/tar.c (decode_options): Adjust to new signature for get_date.
1562
1563         * src/buffer.c (short_read, flush_read): Use size_t, not ssize_t, for
1564         result of safe_read, full_write, and similar functions.
1565         Detect safe_read error by comparing to SAFE_READ_ERROR;
1566         detect full_write error by comparing to 0.
1567         All uses changed.
1568         * src/common.h (write_error_details, sys_write_archive_buffer):
1569         Likewise.
1570         * src/misc.c (write_error_details): Likewise.
1571         * src/rmt.c (main): Likewise.
1572         * src/rmt.h (rmt_read__, rmt_write__): Likewise.
1573         * src/rtapelib.c (rmt_read__, rmt_write__, rmt_ioctl__): Likewise.
1574         * src/sparse.c (sparse_scan_file, sparse_dump_region,
1575         check_sparse_region, check_data_region): Likewise.
1576         * src/system.c (sys_write_archive_buffer, sys_drain_input_pipe,
1577         sys_child_open_for_compress, sys_child_open_for_uncompress): Likewise.
1578         * src/update.c (append_file): Likewise.
1579
1580         * src/buffer.c (clear_read_error_count): Use explicit (void)
1581         to indicate a function with no arguments.
1582         * src/create.c (check_links): Likewise.
1583         * src/system.c (sys_get_archive_stat, sys_save_archive_dev_ino,
1584         sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell,
1585         sys_reset_uid_gid, sys_get_archive_stat, sys_save_archive_dev_ino,
1586         sys_detect_dev_null_output, sys_drain_input_pipe, sys_spawn_shell):
1587         Likewise.
1588         * src/utf8.c (get_input_charset): Likewise.
1589         * src/xheader.c (xheader_ghdr_name, xheader_write_global,
1590         xheader_decode_global, extended_header_init): Likewise.
1591         * tests/mksparse.c (usage): Likewise.
1592
1593         * src/buffer.c (new_volume): Rename local variables to avoid
1594         shadowing warnings.
1595         * src/common.h (file_dumpable_p, sys_stat_nanoseconds,
1596         sparse_file_p, sparse_member_p, sparse_fixup_header,
1597         sparse_dump_file, sparce_extract_file, sparse_skip_file,
1598         sparse_diff_file): Likewise.
1599         * src/compare.c (diff_archive): Likewise.
1600         * src/create.c (file_dumpable_p, dump_regular_file, dump_dir0,
1601         dump_dir, dump_hard_link, file_count_links, dump_file0, dump_file):
1602         Likewise.
1603         * src/extract.c (repair_delayed_set_stat): Likewise.
1604         * src/misc.c (maybe_backup_file, add_hierarchy_to_namelist):
1605         Likewise.
1606         * src/sparse.c (struct tar_sparse_optab, tar_sparse_dump_region,
1607         tar_sparse_extract_region, sparse_dump_region, sparse_extract_region,
1608         sparse_dump_file, sparse_file_p, sparse_member_p,
1609         sparse_fixup_header, sparse_extract_file, sparse_skip_file,
1610         check_data_region, sparse_diff_file): Likewise.
1611         * src/system.c (sys_stat_nanoseconds): Likewise.
1612         * src/xheader.c (xheader_format_name): Likewise.
1613
1614         * src/common.h (enum old_files): Remove comma before }; not portable.
1615
1616         * src/common.h (read_fatal_details): Add __attribute__ ((noreturn)).
1617         * src/rmt.c (usage): Likewise.
1618         * src/xheader.c (xheader_set_single_keyword): Likewise.
1619         * tests/genfile.c (usage): Likewise.
1620         * tests/mksparse.c (die, usage): Likewise.  Also add printf attribute
1621         to die.
1622
1623         * src/common.h (gname_to_gid, uname_to_uid): Add const to avoid
1624         some gcc warnings.
1625         * src/names.c (uname_to_uid, gname_to_gid): Likewise.
1626         * src/utf8.c (struct langtab.lang, struct langtab.terr, struct
1627         langtab.charset, charset_lookup): Likewise.
1628
1629         * src/common.h (name_init): Remove unused args.  All callers changed.
1630         * src/names.c (name_init): Likewise.
1631
1632         * src/common.h (usage, xheader_write, xheader_write_global,
1633         sys_reset_uid_gid): New decls.
1634
1635         * src/compare.c (report_difference, process_noop): Add
1636         __attribute__ ((unused)) for unused attributes.
1637         * src/sparse.c (oldgnu_sparse_member_p, star_sparse_member_p):
1638         Likewise.
1639         * src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
1640         gid_coder, gname_coder, linkpath_coder, ctime_coder, mtime_coder,
1641         path_coder, size_coder, uid_coder, uname_coder,
1642         sparse_numblocks_coder): Likewise.
1643
1644         * src/create.c (dump_regular_finish, dump_dir0, dump_dir,
1645         dump_file0): Now static.
1646         * src/utf8.c (charset_lookup): Likewise.
1647         * src/xheader.c (xheader_protected_pattern_p,
1648         xheader_protected_keyword_p, xheader_set_single_keyword,
1649         xheader_keyword_deleted_p, xheader_keyword_override_p,
1650         xheader_list_append, xheader_list_destroy, xheader_set_keyword_equal):
1651         Likewise.
1652         * tests/genfile.c (usage): Likewise.
1653         * tests/mksparse.c (die, mkhole, mksparse, usage, xlat_suffix):
1654         Likewise.
1655
1656         * src/create.c (hash_link): Rewrite to avoid cast.
1657
1658         * src/extract.c (file_newer_p): Use parameter, not global var.
1659         * src/misc.c (write_error_details): Likewise.
1660
1661         * src/extract.c (prepare_to_extract): Remove directory arg; not
1662         used.  All callers changed.
1663
1664         * src/misc.c (close_fatal): Remove; not used.
1665         * src/system.c (sys_utimes): Likewise.
1666
1667         * src/rmt.c (get_string): Avoid buffer overrun (off by 1 error).
1668
1669         * src/rmt.c (main): Update copyright date to 2004.
1670         * src/tar.c (decode_options): Likewise.
1671
1672         * src/rtapelib.c (get_status_string): Don't lose errno when
1673         skipping the error messages.
1674         (get_status): Report an error if atol returns a negative number.
1675
1676         * src/utf8.c (struct langtab, langtab, charset_lookup,
1677         get_input_charset) [!defined HAVE_LIBCONV]: Omit unused
1678         definitions.
1679         (iconv_open, iconv, iconv_close) [!defined HAVE_LIBCONV]:
1680         Use macros, not definitions, to avoid type clashes with system
1681         headers.
1682         (charset_lookup): Local var is now auto, not static.
1683         (utf8_convert): Use ICONV_CONST instead of const, to avoid
1684         type clashes.
1685
1686         * src/utf8.c (langtab): Initialize all elements of struct, to
1687         avoid gcc warning.
1688         * src/xheader.c (xhdr_tab): Likewise.
1689
1690         * src/xheader.c: Include fnmatch.h, since we use fnmatch.
1691
1692         * tests/mksparse.c (mkhole): Fix typo: bool was assigned to off_t.
1693
1694 2004-04-04  Sergey Poznyakoff  <gray@Noldor.runasimi.org>
1695
1696         * NEWS: Updated
1697         * configure.ac: Raised version number to 1.13.94
1698         * src/system.h: Protect inclusion of <sys/time.h>
1699         by ifdef.
1700         Declare time() if HAVE_DECL_TIME is 0
1701         * tests/.cvsignore: Added mksparse
1702
1703         * tests/sparse01.sh: New file
1704         * tests/multiv02.sh: New file
1705         * tests/Makefile.am: Add sparse01.sh and multiv02.sh
1706         * tests/longv7.sh: Added missing call to 'after'
1707
1708         * src/common.h: Added missing prototypes
1709         * src/compare.c (diff_archive): Use is_sparse member
1710         instead of GNUTYPE_SPARSE.
1711         * src/create.c: Removed unused variables
1712         * src/extract.c (extract_archive): Use sparse_member_p instead
1713         of GNUTYPE_SPARSE.
1714         Removed unused variables
1715         * src/list.c (decode_header): Use sparse_fixup_header to correct
1716         the st_size value.
1717         (print_header): Do not rely on GNUTYPE_SPARSE type.
1718         Use st->stat.st_size to print real file size.
1719         (skip_member): Assign stat_info.file_name to save_name. This fixes
1720         bug reported by Mads Martin Joergensen <mmj@suse.de>
1721         Use sparse_skip_file() to skip sparse members.
1722         * src/rtapelib.c: include "common.h"
1723         * src/sparse.c (struct tar_sparse_optab.sparse_member_p)
1724         (struct tar_sparse_optab.fixup_header): New member
1725         (tar_sparse_member_p): New function.
1726         (tar_sparse_init): Return true if decode_header is not provided
1727         (tar_sparse_fixup_header)
1728         (sparse_member_p,sparse_fixup_header)
1729         (sparse_skip_file)
1730         (oldgnu_sparse_member_p,oldgnu_fixup_header,star_sparse_member_p)
1731         (star_fixup_header, pax_sparse_member_p): New function
1732         (pax_decode_header): Remove
1733         * src/system.h: Include <sys/time.h> and <utime.h> when available
1734         * src/tar.c (usage): Prototype moved to common.h
1735         * src/tar.h (struct tar_stat_info.is_sparse): New member
1736         * src/utf8.c (utf8_convert): Changed prototype
1737         (get_input_charset): Removed unused variable
1738         * src/xheader.c: include <fnmatch.h>
1739         (size_decoder): Assign to both st->archive_file_size and
1740         st->stat.st_size.
1741         (st->stat.st_size): Assign to st->stat.st_size
1742         (sparse_numbytes_decoder): Removed unused variable
1743         * src/.cvsignore: Added .gdbinit
1744         * THANKS: Added Mads Martin Joergensen
1745
1746 2004-03-26  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1747
1748         * src/create.c (write_long_name): Do not allow more than
1749         NAME_FIELD_SIZE-1 characters in a file name for V7 format
1750         archives.
1751         * tests/longv7.sh: New file.
1752         * tests/Makefile.am: Add longv7.sh
1753
1754 2004-03-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1755
1756         * src/buffer.c (open_archive): Clear read_full_records_option
1757         if reading from a pipe.
1758         (short_read): Display warning about the deduced record size
1759         if version > 1
1760         * tests/star/pax-big-10g.sh: Updated to match the above changes.
1761         * tests/star/ustar-big-2g.sh: Likewise.
1762         * tests/star/ustar-big-8g.sh: Likewise.
1763
1764         * configure.ac: Added gl_FUNC_STRTOULL
1765         * src/create.c (start_header): Check for GNU_FORMAT
1766         if incremental_option is set.
1767         * src/xheader.c (to_decimal): New function.
1768         (xheader_format_name): Use to_decimal() instead of snprintf.
1769         * tests/listed01.sh: Use genfile instead of dd
1770         * tests/multiv01.sh: Likewise.
1771
1772 2004-03-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1773
1774         * src/list.c (read_and): Stop processing the archive after
1775         encountering a single zero record. Many old archives contain
1776         arbitrary garbage after it.
1777         The warning is issued anyway.
1778
1779 2004-03-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1780
1781         * src/rtapelib.c (rmt_lseek__,rmt_ioctl__): Bugfix. The
1782         conversion buffer was not null terminated. Fix provided
1783         by Leland Lucius <llucius@tiny.net>
1784         * THANKS: Added Leland Lucius
1785         * src/utf8.c (utf8_convert): Indentation fix.
1786
1787 2004-02-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1788
1789         * src/buffer.c (flush_read): Bugfix: the
1790         condition at line 714 included
1791
1792               || (status > 0 && !read_full_records_option)
1793
1794         which is grossly wrong, since even if new_volume() below succeeds,
1795         the subsequent call to rmtread will overwrite the chunk of data
1796         already read in the buffer and thus spoil everything.
1797         * src/system.c (sys_child_open_for_uncompress): Minor stylistic
1798         fix.
1799         * tests/star/multi-fail.sh: New test.
1800         * tests/Makefile.am: Added multi-fail.sh
1801         * tests/star/README: Updated
1802
1803 2004-02-29  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1804
1805         * NEWS: Updated
1806         * configure.ac: Removed spurious AC_CHECK_LIB(iconv)
1807         * src/common.h (utc_option): new global
1808         (enum old_files.KEEP_NEWER_FILES): New element
1809         * src/extract.c: Handle --keep-newer-files option
1810         * src/list.c (tartime): Print UTC if --utc was given.
1811         * src/tar.c: New options: --utc and keep-newer-files
1812
1813         * tests/Makefile.am: Added new tests
1814         * tests/after: Rewritten
1815         * tests/before: Rewritten
1816         * tests/preset.in: Rewritten
1817         * tests/delete03.sh: Accommodate for the new testsuite logic
1818         * tests/gzip.sh: Likewise
1819         * tests/incremen.sh: Likewise
1820         * tests/listed01.sh: Likewise
1821         * tests/multiv01.sh: Likewise
1822         * tests/old.sh: Likewise
1823         * tests/options.sh: Likewise
1824         * tests/version.sh: Likewise
1825         * tests/volume.sh: Likewise
1826
1827         * tests/star: New directory
1828         * tests/star/README: New file
1829         * tests/star/gtarfail.sh: New file
1830         * tests/star/gtarfail2.sh: New file
1831         * tests/star/pax-big-10g.sh: New file
1832         * tests/star/qucktest.sh: New file
1833         * tests/star/ustar-big-2g.sh: New file
1834         * tests/star/ustar-big-8g.sh: New file
1835
1836 2004-02-26  Paul Eggert  <eggert@twinsun.com>
1837
1838         * doc/tar.texi (dircategory Individual utilities): Append period,
1839         as suggested by Karl Berry.
1840
1841 2004-02-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1842
1843         * src/list.c (decode_header): Call xheader_decode before
1844         the assignment to current_stat_info.archive_file_size.
1845
1846 2004-02-23  Paul Eggert  <eggert@twinsun.com>
1847
1848         * configure.ac: Invoke AM_ICONV, to define ICONV_CONST if needed.
1849
1850 2004-02-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1851
1852         1.13.93 released.
1853
1854         * NEWS: Updated
1855         * tests/before: Move testing of the prerequisite archive formats
1856         to the separate function 'prereq'. Do not expect any arguments
1857         * tests/delete03.sh: Use prereq() instead of passing arguments
1858         to 'before'.
1859         * tests/incremen.sh: Likewise.
1860         * tests/listed01.sh: Likewise.
1861         * tests/multiv01.sh: Likewise.
1862
1863 2004-02-22  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1864
1865         Added UTF-8 support. Finished global extended header
1866         support.
1867
1868         * NEWS: Minor fix
1869         * configure.ac: Detect libiconv
1870         * src/utf8.c: New file. Conversions to and from utf-8.
1871         * src/Makefile.am: Added utf8.c
1872         * src/create.c (write_header_name) In pax format, use
1873         "path" keyword if the file name is not ASCII
1874         (start_header): Likewise for uname and gname.
1875         * src/list.c: Decode encountered global headers.
1876         * src/xheader.c: Use keywords from the global
1877         headers.
1878         Correctly handle UTF-8 conversions.
1879         (xheader_list_destroy): New function.
1880         (xheader_set_single_keyword,xheader_set_keyword_equal): Added
1881         missing gettext markers
1882         (decode_record): Rewritten using caller-provided handler and
1883         data closure.
1884         * tests/listed01.sh: Give credit to Andreas Schuldei.
1885
1886 2004-02-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1887
1888         * src/create.c (dump_file0): The conditional at line
1889         1296 prevented incremental backups on individual files
1890         from working, as reported by Andreas Schuldei
1891         <andreas@schuldei.org>.
1892
1893         This is due to the condition
1894
1895           (0 < top_level || !incremental_option)
1896
1897         Removing it makes incremental backups work for individual
1898         files as well as for directories. On the other hand, it does
1899         not affect other functionality, as shown by the reasoning below:
1900
1901         To begin with, the two parts of this condition are mutually
1902         superfluous, because
1903
1904           1) when top_level < 0, incremental_option == 1
1905           so the condition yields false
1906           2) when top_level >= 0, incremental_option == 0
1907           so the condition yields true.
1908
1909         In other words, it is completely equivalent to
1910
1911               (!incremental_option)
1912
1913         Now, let's consider the effect of its removal. There are two cases:
1914
1915         1) when incremental_option==1
1916         This means incremental backup in progress. In this case dump_file
1917         is invoked only for directories or for files marked with 'Y' by
1918         get_directory_contents. The latter are those that did not meet the
1919         condition in incremen.c:242, which is exactly the same condition
1920         as this at create.c:1296. So, for these files the check
1921         (!incremental_option) is useless, since the rest of the
1922         conditional will yield false anyway. On the other hand, if
1923         dump_file is invoked on a directory, the conditional will yield
1924         false due to !S_ISDIR assertion, so these will be processed as usual.
1925
1926         Thus, for this case the extra condition (!incremental_option) is
1927         irrelevant, and its removal won't alter the behavior of tar,
1928         *except* that it will enable incremental backups on individual
1929         files, which is the wanted effect.
1930
1931         2) when incremental_option==0
1932         In this case the condition yields true and its removal does not
1933         affect the functionality.
1934
1935         * THANKS: Updated
1936         * configure.ac: Raised patchlevel to 93
1937         * src/incremen.c: Minor stylistic fixes.
1938         * tests/listed01.sh: New test. Check listed incremental
1939         backups on individual files.
1940         * tests/Makefile.am: Added listed01.sh
1941
1942 2004-02-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1943
1944         * src/common.h (simple_finish_header,start_private_header): New
1945         declarations
1946         (xheader_ghdr_name): Changed declaration
1947         * src/create.c (start_private_header): Removed static qualifier.
1948         (write_extended): Removed superfluous last argument. Use
1949         xheader_write()
1950         (simple_finish_header): New function.
1951         (finish_header): Use simple_finish_header() to break recursive
1952         dependency between this function and write_extended().
1953         * src/tar.c (assert_format): Do not bail out if several
1954         --format arguments are given. This is a common case when
1955         TAR_OPTIONS are used.
1956         (decode_options): New option --show-defaults displays the
1957         compiled-in defaults.
1958         Use POSIX format if no --format option was given and
1959         --pax-option was specified.
1960         Do not allow to use --pax-option unless the archive format is
1961         set to POSIX (or reading subcommand is requested).
1962
1963         * src/update.c (update_archive): Write global extended header if
1964         constructed.
1965         * src/xheader.c (xheader_format_name): Bugfix.
1966         (xheader_xhdr_name): Changed the default extended header name
1967         to '%d/PaxHeaders.%p/%f', as POSIX requires.
1968         (xheader_ghdr_name): Removed unused argument.
1969         (xheader_write,xheader_write_global): New function.
1970         (xheader_decode): Modified to honor overrides whatever
1971         the current archive format is.
1972
1973         * src/delete.c (delete_archive_members): Call xheader_decode
1974         unconditionally.
1975         * src/list.c (decode_header): Likewise.
1976         * src/incremen.c (sort_obstack): Fixed typo in the comment
1977
1978         * doc/tar.texi: Document new default for extended
1979         header names.
1980
1981         * tests/before: Accept an optional list of allowed archive
1982         formats. Exit with the status 77 if the current archive
1983         format does not match any of them.
1984         * tests/delete03.sh: Require gnu, oldgnu or posix format
1985         * tests/incremen.sh: Require gnu or oldgnu format
1986         * tests/multiv01.sh: Likewise
1987
1988 2004-02-20  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1989
1990         * doc/tar.texi (Option Summary): Documented --pax-option
1991         * src/tar.c: Likewise.
1992         * NEWS: Likewise.
1993         * src/create.c (to_chars): Added a comment.
1994         * src/tar.h: Comment to GNU_FORMAT
1995
1996 2004-02-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
1997
1998         * README: Updated
1999         * configure.ac: Added stpcpy
2000         * bootstrap: Likewise
2001         * lib/Makefile.am: Likewise
2002         * src/common.h (xheader_xhdr_name,xheader_ghdr_name): New
2003         functions
2004         * src/create.c (write_extended): Call xheader_xhdr_name
2005         instead of using hardcoded "././@PaxHeader" name.
2006         * src/tar.c: New option --pax-option (equivalent to -o option
2007         of pax).
2008         * src/xheader.c: Implement pax -o option. Fixed misleading
2009         heading comment (introduced 2003-09-02).
2010         * src/incremen.c: Minor fixes
2011         * m4/.cvsignore: Updated
2012
2013 2004-02-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2014
2015         * src/incremen.c: Removed accumulator stuff in favor of obstack.
2016         (get_directory_contents): Split into two functions
2017         * src/update.c: Minor changes
2018         * doc/tar.texi: Fixed typo
2019
2020 2004-02-15  Paul Eggert  <eggert@twinsun.com>
2021
2022         Fix Debian bug 230872, originally reported by Jeff King in
2023         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=230872>.
2024
2025         * doc/tar.texi (posix compliance): Remove.  The whole section
2026         was a misunderstanding of what POSIXLY_CORRECT is supposed to
2027         mean.  The GNU Coding Standards says that POSIXLY_CORRECT
2028         is for disabling extensions that are incompatible with POSIX:
2029         it is not for disabling compatible extensions.  All references
2030         to this section removed.
2031         (posix): This format is created only if the posix format is
2032         specified; it is no longer created if gnu format is specified
2033         and POSIXLY_CORRECT is set.
2034         * src/tar.c (decode_options): Ignore POSIXLY_CORRECT.
2035         POSIX does not specify the behavior of tar, so we should
2036         not worry about POSIXLY_CORRECT here.
2037
2038 2004-01-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2039
2040         * Makefile.am: Removed m4
2041         * configure.ac: Require automake-1.8/autoconf-2.59. Removed
2042         m4/Makefile.
2043         * README-alpha: Updated
2044         * bootstrap: Updated TP URL, improved help output. Default
2045         to :ext:anoncvs and set CVS_RSH, unless already set.
2046         * m4/Makefile.am: Removed
2047
2048 2004-01-21  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2049
2050         * bootstrap: Bugfix by Marco Gerards <metgerards@student.han.nl>:
2051         Use $option instead of $1 so all options will be parsed.
2052
2053 2004-01-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2054
2055         Started rewriting buffer.c ...
2056
2057         * bootstrap: New option --no-po
2058         * src/buffer.c (new_volume,check_label_pattern): Changed return type.
2059         (time_to_start_writing): Changed data type
2060         (file_to_switch_to): Removed. Variable never assigned to.
2061         (open_archive) Moved option compatibility checks to tar.c
2062         Other minor changes.
2063         * src/common.h (maybe_backup_file): Changed return type
2064         * src/misc.c: Likewise.
2065         * src/create.c: Updated invocations of safer_name_suffix
2066         * src/extract.c: Likewise
2067         * src/delete.c: Updated assignment to write_archive_to_stdout
2068         * src/tar.c (decode_options): More option compatibility checks
2069         (moved from buffer.c)
2070         * src/update.c (time_to_start_writing): Changed data type.
2071         * tests/recurse.sh: New test case.
2072         * tests/mksparse.c: New file.
2073         * tests/Makefile.am: Added recurse.sh and mksparse.c
2074
2075 2004-01-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2076
2077         * src/sparse.c (sparse_diff_file): Bugfix. Thanks
2078         Martin Simmons for the patch.
2079         * src/create.c (dump_dir0): Bugfix. Thanks Piotr Czerwinski
2080         <pius@pld-linux.org> for the patch.
2081
2082 2003-12-26  Paul Eggert  <eggert@twinsun.com>
2083
2084         Synchronize with Gettext 0.13.1, Automake 1.8, Autoconf 2.59,
2085         and translation website.
2086
2087         * bootstrap: Don't bother skipping codeset.m4, glibc21.m4,
2088         intdiv0.m4, inttypes_h.m4, inttypes.m4, inttypes-pri.m4,
2089         isc-posix.m4, and lcmessage.m4 from gnulib.  This list of files is
2090         a bit obsolete anyway, now that gettext 0.13.1 is out.  Also, the
2091         files are replaced by autoreconf.  Also, there seems to be a bug
2092         in gettext/autoconf/automake if we try to omit these files after
2093         autoreconf has replaced them, even though the gettext manual says
2094         they're optional.  So give up and just include them for now, even
2095         though they make 'configure' longer and slower.
2096
2097         Change translation URL from
2098         <http://www.iro.umontreal.ca/contrib/po/maint/tar/> to
2099         <http://www2.iro.umontreal.ca/~gnutra/po/maint/tar/> to
2100         accommodate translator website revamp.
2101
2102         Fail if autoreconf fails.
2103
2104         * m4/.cvsignore: Add intmax.m4, longdouble.m4, printf-posix.m4,
2105         signed.m4, size_max.m4, wchar_t.m4, wint_t.m4, xsize.m4, to
2106         ignore files now supplied by gettext 0.13.1.
2107
2108 2003-12-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2109
2110         Synchronized with the backup repository on Mirddin
2111
2112 2003-12-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2113
2114         * configure.ac: Check for varios members of struct stat
2115         that may represent file modification times with a subsecond
2116         precision.
2117         Check for utimes (for future use)
2118         * src/buffer.c (short_read): Issue a warning on short reads.
2119         * src/common.h (sys_stat_nanoseconds): New function
2120         * src/create.c (dump_file0): Use sys_stat_nanoseconds().
2121         * src/list.c (read_and): Treat only two successive zero
2122         filled blocks as an EOF indicator. Issue a warning if
2123         a single one is encountered.
2124         * src/system.c (sys_stat_nanoseconds): New function
2125         * src/tar.h (tar_stat_info.atime_nsec,mtime_nsec,ctime_nsec): New
2126         members.
2127         * src/xheader.c (code_time,decode_time): Support for subsecond
2128         precision.
2129         (atime_coder,atime_decoder,ctime_coder,ctime_decoder)
2130         (mtime_coder,mtime_decoder): Update invocations of code_time and
2131         decode_time.
2132         (gid_decoder,size_decoder,uid_decoder,sparse_size_decoder)
2133         (sparse_numblocks_decoder,sparse_offset_decoder)
2134         (sparse_numbytes_decoder): Updated
2135
2136 2003-12-18  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2137
2138         * src/names.c (safer_name_suffix): Reverted change made
2139         2003-11-14. Reason: Discussion with Paul Eggert and
2140         Jean-Louis Martineau. See also ChangeLog entry from
2141         1999-08-14.
2142         * tests/delete03.sh: Likewise.
2143         * tests/extrac04.sh: Likewise.
2144         * tests/multiv01.sh: Likewise.
2145
2146 2003-12-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2147
2148         * src/incremen.c (write_directory_file): Use sys_truncate
2149         * src/list.c (print_header): Use archive_file_size member
2150         when printing real file size.
2151         * src/sparse.c (sparse_scan_file): Correctly handle files with
2152         a hole at the end.
2153         (sparse_dump_region,sparse_extract_region): Allow for zero size
2154         trailing blocks
2155
2156 2003-12-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2157
2158         * configure.ac: Raised version number to 1.13.92
2159         * src/list.c (decode_header): Discern between pax and ustar
2160         formats
2161         Initialize current_stat_info.archive_file_size.
2162
2163         NOTE: Modifications from this date on are temporarily
2164         stored on local CVS on mirddin. This repository will
2165         be synchronized with Savannah as soon as the latter
2166         becomes operational again.
2167
2168 2003-12-01  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2169
2170         * TODO: Updated
2171         * src/sparse.c: Initial implementation of GNU/pax sparse
2172         file format.
2173         * src/common.h (xheader_store): Changed prototype.
2174         * src/create.c: Update calls to xheader_store
2175         * src/extract.c (extract_archive): Check reported size vs.
2176         archive file size to determine if we have to do with a
2177         sparse file.
2178         * src/tar.c (usage): Cleaned up the sample argument to --newer
2179         option.
2180         (decode_options): Allow --sparse for POSIX_FORMAT archives.
2181         * src/xheader.c (struct xhdr_tab.coder; all coder function): Added
2182         extra argument
2183         Implemented GNU.sparse.* keywords.
2184
2185 2003-11-30  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2186
2187         * configure.ac: Check for setlocale. Thanks Bruno Haible for
2188         reporting.
2189
2190 2003-11-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2191
2192         * src/create.c (write_gnu_long_link): Use oldgnu
2193         magic with @LongLink blocks.
2194
2195 2003-11-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2196
2197         * src/tar.h: Support for star sparse format.
2198         * src/sparse.c: Likewise.
2199
2200 2003-11-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2201
2202         * src/sparse.c (sparse_diff_file): New function
2203         * src/common.h (sys_compare_uid,sys_compare_gid): New functions
2204         (sys_compare_uid_gid): Removed.
2205         (sys_compare_links,report_difference): Changed prototype
2206         (sparse_diff_file): New function
2207         * src/system.c (sys_compare_uid,sys_compare_gid): New functions
2208         (sys_compare_uid_gid): Removed.
2209         (sys_compare_links): Changed declaration
2210         * src/compare.c (diff_archive): Use sparse_diff_file.
2211
2212 2003-11-16  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2213
2214         Rewritten sparse file handling.
2215
2216         * src/sparse.c: New file. Provides a universal framework
2217         for various methods for sparse files handling.
2218         * src/Makefile.am: Added sparse.c
2219         * src/common.h (struct sp_array,sparsearray,sp_array_size)
2220         (init_sparsearray,fill_in_sparse_array): Removed
2221         (enum dump_status): New data type
2222         (pad_archive,close_diag,open_diag,read_diag_details)
2223         (readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
2224         functions.
2225         (sparse_file_p,sparse_dump_file,sparse_extract_file): New
2226         functions.
2227         (print_header): Changed prototype declaration.
2228         * src/tar.h (struct sp_array): Declaration from common.h
2229         (struct tar_stat_info): New members archive_file_size,
2230         sparse_map_avail,sparse_map.
2231         * src/create.c: Major rewrite.
2232         * src/extract.c: Use new sparse file interface.
2233         * src/compare.c (diff_sparse_files): Temporary placeholder.
2234
2235         * src/buffer.c: Minor changes
2236         * src/tar.c: Likewise.
2237         * src/list.c: Likewise.
2238         * src/misc.c (close_diag,open_diag,read_diag_details)
2239         (readlink_diag,savedir_diag,seek_diag_details,stat_diag): New
2240         diagnostics functions.
2241         * src/incremen.c: Use new diagnostics functions.
2242         * src/names.c: Likewise.
2243
2244 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2245
2246         * configure.ac: Fixed check for setsockopt
2247
2248         * src/create.c: Do not zero-terminate name field if
2249         the name is exactly 100 characters long.
2250         (write_ustar_long_name): Fixed cheking for unsplittable
2251         names.
2252
2253 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2254
2255         * src/create.c (start_header): Removed debugging hook
2256         (dump_file): Fixed handling of linkname field.
2257         * src/names.c (safer_name_suffix): If the input
2258         file name ends with a slash, output one should do so
2259         as well.
2260         * doc/tar.texi: Documented --format=ustar
2261
2262 2003-11-14  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2263
2264         * src/tar.h (archive_format): USTAR_FORMAT: New type.
2265         * src/create.c: Added POSIX.1-1988 support.
2266         * src/names.c (safer_name_suffix): Skip leading ./
2267         * src/tar.c: New option --format=ustar forces
2268         POSIX.1-1988 archive format.
2269         * tests/delete03.sh: Updated.
2270         * tests/extrac04.sh: Updated.
2271         * tests/multiv01.sh: Updated.
2272
2273 2003-11-13  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2274
2275         * src/list.c (read_and): Initialize current_stat_info
2276         and extended_header at the start of the loop.
2277         * src/names.c (all_names_found): Check if the argument
2278         contains valid filename. Fixes coredump on `not_a_tar_file'
2279         * src/xheader.c (atime_decoder,gid_decoder,ctime_decoder)
2280         (mtime_decoder,size_decoder,uid_decoder): Use xstrtoumax.
2281         Fixes `pax-big-10g' bug.
2282
2283 2003-11-12  Paul Eggert  <eggert@twinsun.com>
2284
2285         Fix some C compatibility bugs reported by Joerg Schilling.
2286
2287         * src/common.h (stripped_prefix_len): Fix misspelling
2288         "stripped_path_len" in declaration.
2289         * src/rmt.c (main): Use "return FOO;" rather than
2290         "exit (FOO);"; we no longer have to worry about
2291         pre-ANSI hosts that mishandled returned values from "main".
2292         * src/tar.c (main): Likewise.  This avoids warnings on some
2293         compilers.
2294         * src/system.c: Include signal.h, for 'kill'.
2295         * src/system.h (DEV_BSIZE): Remove.
2296         (DEFAULT_ST_BLKSIZE): New macro.
2297         (ST_BLKSIZE): Use it, instead of DEV_BSIZE.
2298         * src/tar.c (enum): Remove comma just before }.
2299
2300 2003-11-12  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2301
2302         * src/list.c (decode_header): Initialize st_atime and
2303         st_ctime.
2304
2305 2003-11-11  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2306
2307         * configure.ac (tar_save_LIBS): Bugfix. Thanks Adrian
2308         Bunk <bunk@fs.tum.de> for reporting.
2309         * doc/tar.texi: Fixed spelling. Thanks Martin Buchholz
2310         <martin@xemacs.org> for spotting.
2311
2312 2003-11-04  Paul Eggert  <eggert@twinsun.com>
2313
2314         * src/xheader.c (xhdr_tab): Make it extern, not static, as C89 and
2315         C99 require this.
2316
2317 2003-10-26  Paul Eggert  <eggert@twinsun.com>
2318
2319         * src/system.c (sys_spawn_shell): Cast trailing null to (char *).
2320         Bug reported by Christian Weisgerber.
2321
2322 2003-10-19  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2323
2324         * AUTHORS: Updated
2325         * NEWS: Updated
2326         * src/tar.c (decode_options): Removed superfluous archive format
2327         check
2328         * doc/tar.texi: Documented new features.
2329
2330 2003-10-08  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2331
2332         * NEWS: Updated
2333         * THANKS: Added Wojciech Polak
2334         * configure.ac: Added checks for missing functions. Raised
2335         version number to indicate alpha release.
2336         * lib/Makefile.am: Added missing headers
2337         * lib/waitpid.c: Added missing includes.
2338         * src/extract.c: Likewise.
2339         * src/names.c: Removed spurious includes.
2340         * src/xheader.c: Likewise.
2341         * src/system.h [MSDOS]: Fixed spelling of EACCES. Added
2342         macro overriding broken mkdir prototypes.
2343
2344 2003-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2345
2346         * configure.ac: Check for dev_t and ino_t.
2347         * m4/Makefile.am: Added missing files.
2348         * src/system.c: New file.
2349         * src/Makefile.am: Added system.c
2350         * src/common.h: Prototypes for functions from system.c
2351         * src/system.h (SET_BINARY_MODE, ERRNO_IS_EACCESS): New defines
2352         * src/buffer.c: Moved system dependencies to system.c
2353         * src/compare.c: Likewise.
2354         * src/create.c: Likewise.
2355         * src/delete.c: Likewise.
2356         * src/extract.c: Likewise.
2357         * src/rtapelib.c: Likewise.
2358
2359 2003-10-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2360
2361         Implemented --occurrence option.
2362
2363         * NEWS: Updated.
2364         * src/tar.c: New option --occurrence.
2365         * src/common.h (occurrence_option): New global
2366         (struct name): Changed `found' member to `uintmax_t
2367         found_count'.
2368         (names_done): Removed
2369         (all_names_found): Changed prototype.
2370         (ISFOUND,WASFOUND): New macros
2371         * src/delete.c (delete_archive_members): Honor --occurrence
2372         option.
2373         * src/list.c (read_and): Likewise.
2374         * src/names.c: Count number of occurrences of each name in the
2375         archive.
2376         (name_match): Honor --occurrence option.
2377         (names_done): Removed
2378         (all_names_found,names_notfound): Rewritten.
2379
2380 2003-10-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2381
2382         * src/tar.c: Removed extra precaution regarding
2383         subcommand_option == CAT_SUBCOMMAND
2384         * lib/Makefile.am: Updated
2385
2386 2003-10-02  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2387
2388         * src/common.h (names_done): New function.
2389         * src/names.c: Likewise.
2390         * src/list.c (read_and): Use all_names_found() as `while'
2391         condition.
2392         * src/tar.c: New option --first-copy
2393         * NEWS: Updated
2394
2395 2003-09-24  Paul Eggert  <eggert@twinsun.com>
2396
2397         * src/rmt.c (main): Don't translate Copyright string; international
2398         law says the word "Copyright" should be in English.
2399         * src/tar.c (decode_options): Likewise.
2400
2401 2003-09-22  Paul Eggert  <eggert@twinsun.com>
2402
2403         * doc/tar.texi (extracting untrusted archives): New section.
2404
2405         * src/common.h (stripped_path_len): Renamed from cut_path_elements.
2406         Return size_t, not pointer, so that we don't have to worry about
2407         violating the C standard by converting char const * to char *.
2408         All callers changed.
2409         * src/names.c (stripped_path_len): Likewise.  Strip file system
2410         prefix, too.  Count adjacent slashes as if they were one slash;
2411         that is the POSIX standard.
2412
2413 2003-09-17  Paul Eggert  <eggert@twinsun.com>
2414
2415         * README-alpha: Document maintainer tool assumptions a bit.  GNU
2416         'sed' is no longer required.  For GNU m4 1.4, suggest the patch in
2417         Debian bug 211447.  Fix minor misspellings/whitespace nits.
2418
2419         * configure.ac (AC_AIX, AC_MINIX): Remove; subsumed by
2420         gl_USE_SYSTEM_EXTENSIONS.
2421
2422         * lib/.cvsignore: Add exit.h, time_r.c, time_r.h.
2423         * m4/.cvsignore: Add restrict.m4, time_r.m4.
2424
2425 2003-09-17  Paul Eggert  <eggert@twinsun.com>
2426
2427         * bootstrap: Don't use "for option; do";
2428         Solaris 8 /bin/sh doesn't like that.
2429
2430 2003-09-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2431
2432         * README-alpha: Updated
2433         * bootstrap: Updated
2434
2435 2003-09-17  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2436
2437         * README-alpha: Updated
2438         * bootstrap: Updated
2439         * po/POTFILES.in: Added src/xheader.c
2440         * src/common.h (cut_path_elements): Added proto.
2441
2442 2003-09-05  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2443
2444         * src/buffer.c: Use ngettext where appropriate.
2445         * src/compare.c: Likewise.
2446         * src/create.c: Likewise.
2447         * src/misc.c: Likewise.
2448         * src/tar.c: Likewise.
2449         * src/update.c: Likewise.
2450
2451 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2452
2453         * .cvsignore: Added *.shar.gz
2454         * NEWS: Updated
2455         * TODO: Updated
2456         * src/common.h (strip_path_elements): New variable.
2457         * src/extract.c (extract_archive): Implemented --strip-path
2458         * src/names.c (cut_path_elements): New function.
2459         * src/tar.c: New option --strip-path=NUM.
2460         (decode_options) Assign boolean values to bool variables.
2461
2462 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2463
2464         * src/delete.c: Fixed deletion from the POSIX archives.
2465         * src/list.c (read_header): Minor change.
2466         * src/tar.c (main): Do not check for volume_label_option
2467         if subcommand_option is not CREATE_SUBCOMMAND.
2468         * src/xheader.c (xheader_decode): Store the header as
2469         well (for eventual delete).
2470
2471         * tests/incremen.sh: Explicitly request GNU format. This will
2472         disappear when GNU extended header keywords are working.
2473         * tests/multiv01.sh: Likewise
2474         * tests/volume.sh: Likewise
2475
2476 2003-09-04  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2477
2478         * src/create.c: Support for "linkpath" extended keyword.
2479         * src/xheader.c (decode_record): Reversed the return
2480         condition.
2481
2482 2003-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2483
2484         * configure.ac: Allow to redefine the default output format.
2485         * src/tar.c: Use DEFAULT_ARCHIVE_FORMAT macro
2486         (archive_format_string): New function.
2487         (usage): Updated help output.
2488         * README: Updated.
2489         * NEWS: Updated.
2490         * TODO: Updated.
2491
2492 2003-09-02  Paul Eggert  <eggert@twinsun.com>
2493
2494         * src/common.h (destroy_stat, xheader_decode, xheader_store,
2495         xheader_read, xheader_finish, xheader_destroy): Add decls;
2496         C99 requires this.
2497
2498         * src/create.c (write_extended): Remove unused local 'bufsize'.
2499
2500         * src/delete.c (delete_archive_members): Handle case of
2501         HEADER_SUCCESS_EXTENDED followed by HEADER_FAILURE.
2502         * src/list.c (read_and): Abort if HEADER_SUCCESS_EXTENDED
2503         occurs, as it's not possible.
2504         * src/update.c (update_archive): Likewise.
2505
2506         Use "const" when possible in new code.
2507         * src/tar.c (struct fmttab.name): Now char const *.  All uses changed.
2508         (fmttab): Now const.  All uses changed.
2509         * src/xheader.c (struct xhdr_tab.keyword): Now pointer to const.
2510         (struct xhdr_tab.coder, struct xhdr_tab.decoder, locate_handler,
2511         decode_record, xheader_store, xheader_print, code_string, code_time,
2512         code_num, dummy_coder, dummy_decoder, atime_coder, atime_decoder,
2513         gid_coder, gid_decoder, gname_coder, gname_decoder, linkpath_coder,
2514         linkpath_decoder, ctime_coder, ctime_decoder, mtime_coder,
2515         mtime_decoder, path_coder, path_decoder, size_coder, size_decoder,
2516         uid_coder, uid_decoder, uname_coder, uname_decoder):
2517         Use pointers to const when possible.
2518         (xhdr_tab): Now const.
2519
2520         * src/tar.c (fmttab): Avoid GCC warning by not eliding initializers.
2521         (set_archive_format): Report an error if no format name matches,
2522         instead of returning an undefined value.
2523
2524         * src/xheader.c (struct xhdr_tab.decoder, dummy_decoder,
2525         atime_decoder, gid_decoder, gname_decoder, linkpath_decoder,
2526         ctime_decoder, mtime_decoder, path_decoder, size_decoder,
2527         uid_decoder, uname_decoder): Remove unused keyword arg.
2528         All uses changed.
2529
2530         * src/tar.c (set_archive_format): Now static.
2531         * src/xheader.c (xhdr_tab, format_uintmax): Now static.
2532
2533         * src/xheader.c (dummy_coder, dummy_decoder, atime_coder,
2534         atime_decoder, gid_coder, gid_decoder, gname_coder, gname_decoder,
2535         linkpath_coder, linkpath_decoder, mtime_coder, mtime_decoder,
2536         ctime_coder, ctime_decoder, path_coder, path_decoder, size_coder,
2537         size_decoder, uid_coder, uid_decoder, uname_coder, uname_decoder):
2538         Remove forward decls; no longer needed.
2539         (xhdr_tab): Move to end, so that the forward decls aren't needed.
2540         Add a forward declaration.
2541
2542         Use 'bool' in new code, when appropriate.
2543         * src/xheader.c (decode_record): Return bool, not int.
2544         * src/common.h (read_header): Since it accepts bool, change
2545         all callers to use false and true rather than 0 and 1.
2546
2547         * src/xheader.c (decode_record): Fix misspelling in diagnostic
2548         "extended headed" -> "extended header".
2549
2550         GNU coding style fixes.
2551         * src/xheader.c (decode_record, xheader_decode):
2552         Do not use decls like "char *p, *q;".
2553
2554         Minor style fixes.
2555         (xheader_store): Avoid parentheses around object operand of sizeof.
2556
2557 2003-09-03  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2558
2559         * src/create.c (start_header): Store long file names
2560         in "path" keyword of an extended header if in POSIX
2561         mode.
2562         (finish_header): print header before calling write_extended().
2563         * src/list.c (list_archive): Always decode the header. This
2564         is necessary so the extended header is processed and the correct
2565         filename is printed no matter what the state of verbose_option.
2566         * src/xheader.c (xhdr_tab): Reserved GNU keywords (commented out
2567         for the time being).
2568
2569 2003-09-01  Paul Eggert  <eggert@twinsun.com>
2570
2571         Update from gnulib, and correct fnmatch to fnmatch-gnu.
2572         * bootstrap (gnulib_modules): Change fnmatch to fnmatch-gnu.
2573         Sort.
2574         * configure.ac (gl_USE_SYSTEM_EXTENSIONS): Use this instead
2575         of AC_GNU_SOURCE.
2576         * lib/.cvsignore: Add alloca.h, stdbool.h.  Sort.  Append newline.
2577         * lib/Makefile.am (lib_OBJECTS): New macro, for convenience when
2578         copying rules from gnulib module descriptions.
2579         (BUILT_SOURCES, EXTRA_DIST, all-local, alloca.h):
2580         Update from gnulib modules alloca, fnmatch, getline, stdbool.
2581         * m4/.cvsignore: Add utimes-null.m4.  Sort.
2582
2583 2003-09-01  Sergey Poznyakoff
2584
2585         Added initial support for creating POSIX headers.
2586
2587         * src/common.h (MAXOCTAL11,MAXOCTAL7): New defines
2588         (string_to_chars): New functions
2589         (struct xheader): Changed structure
2590         (gid_to_gname,gname_to_gid,uid_to_uname,uname_to_uid): Changed
2591         prototypes.
2592         * src/create.c (string_to_chars): New function.
2593         (write_extended): New function
2594         (start_header): Create extended POSIX headers if necessary.
2595         (finish_header): Likewise.
2596         * src/list.c (print_header): Take user/group from
2597         current_stat_info.
2598         * src/names.c (gid_to_gname,gname_to_gid)
2599         (uid_to_uname,uname_to_uid): Changed prototypes.
2600         * src/tar.c: New option --format.
2601         * src/tar.h (OLDGNU_COMPATIBILITY): Removed
2602         (struct extra_header): Removed unused structure.
2603         (union block.extra_header): Removed unused member.
2604         * src/xheader.c: Implemented coder functions.
2605         * bootstrap: Added obstack.
2606         * lib/.cvsignore: Likewise.
2607         * configure.ac: Added 'gl_OBSTACK'
2608         * m4/Makefile.am: Added new files.
2609         * m4/.cvsignore: Likewise.
2610         * TODO: Minor formatting change
2611
2612 2003-08-31  Sergey Poznyakoff
2613
2614         Added initial support for POSIX extended and STAR headers
2615         (only for listing/extracting).
2616
2617         * src/xheader.c: New file.
2618         * src/Makefile.am: Added xheader.c
2619         * src/tar.h (struct star_header): New datatype
2620         (XHDTYPE,XGLTYPE): New defines
2621         (enum archive_format:STAR_FORMAT): New member
2622         (struct tar_stat_info): New datatype.
2623         (union block.star_header): New member.
2624         * src/common.h (orig_file_name,current_file_name)
2625         (current_trailing_slash,current_link_name): Removed variables.
2626         (current_stat_info): New variable
2627         (current_stat): Removed
2628         (extended_header): New variable
2629         (decode_header): Changed prototype.
2630         * src/list.c (decode_header): Added initial support for POSIX extended
2631         and STAR headers.
2632         (skip_member): Check oldgnu_header only if current_format is set
2633         to OLDGNU_FORMAT.
2634         * src/buffer.c: Use current_stat_info
2635         * src/compare.c: Likewise.
2636         * src/create.c: Likewise.
2637         * src/delete.c: Likewise.
2638         * src/incremen.c: Likewise.
2639         * src/mangle.c: Likewise.
2640         * src/update.c: Likewise.
2641         * src/extract.c: Likewise.
2642         (make_directories): Improved check for the existence of the directory
2643         * src/tar.c (destroy_stat): New function.
2644
2645 2003-08-29  Paul Eggert  <eggert@twinsun.com>
2646
2647         * NEWS, bootstrap: Drop en_GB locale; it was more trouble than it
2648         was worth (e.g., different users in en_GB disagree about -ize
2649         versus -ise).
2650         * po/en_GB.po: Remove.
2651
2652 2003-07-28  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2653
2654         * TODO: Updated
2655         * NEWS: Updated
2656         * src/tar.c: Removed support for the obsolete command line
2657         options.
2658         * doc/tar.texi: Removed references to the obsolete command
2659         line options.
2660
2661 2003-07-27  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2662
2663         * TODO: Updated
2664         * NEWS: Updated
2665         * doc/tar.texi: Updated
2666         * src/common.h (check_links_option): New variable
2667         (orig_file_name): New variable
2668         (check_links): New proto.
2669         * src/create.c (struct link.nlink): New member
2670         (link_table): Static for the module.
2671         (dump_file): Update `link' member when adding new links
2672         to the link_table.
2673         (check_links): New function.
2674         * src/list.c (print_header): Use orig_file_name.
2675         * src/tar.c: New option --check-links. Changed semantics of
2676         -o to comply to UNIX98 when extracting and to its previous
2677         semantics otherwise.
2678         (main): Call check_links if --check-links. was given.
2679
2680 2003-07-25  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2681
2682         * src/list.c (print_header): Revised
2683         * NEWS: Started the entry for 1.13.26
2684         * doc/Makefile.am (tar.dvi): Fixed TEXINPUTS value.
2685
2686 2003-07-24  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
2687
2688         * .cvsignore: Added to the repository.
2689         * doc/.cvsignore: Likewise.
2690         * lib/.cvsignore: Likewise.
2691         * m4/.cvsignore: Likewise.
2692         * po/.cvsignore: Likewise.
2693         * scripts/.cvsignore: Likewise.
2694         * src/.cvsignore: Likewise.
2695         * tests/.cvsignore: Likewise.
2696
2697         * lib/Makefile.am: Added exitfail.[hc]
2698         * src/misc.c (chdir_do): Fixed call to restore_cwd
2699         * src/buffer.c (flush_read): Fixed behavior on short
2700         reads right after opening the new archive (multiv01.sh test).
2701         (new_volume): Special handling for "-".
2702         * src/list.c (print_header): Print trailing slash if
2703         current_trailing_slash was set (extrac03.sh,extrac04.sh tests).
2704         * tests/multiv01.sh: Minor changes.
2705         * m4/Makefile.am: Added missing files.
2706
2707 2003-07-05  Paul Eggert  <eggert@twinsun.com>
2708
2709         Finish the checkin begin yesterday.
2710
2711         * NEWS: Document the user-visible changes installed in the last
2712         two days.
2713
2714         * TODO: New file (actually, resurrected; but with new contents).
2715
2716         * src/list.c (read_and): Give full type for procedure arg.
2717         (read_header): Strip trailing slashes, setting current_trailing_slash.
2718         (tartime): Avoid int overflow when printing year (!).
2719         (print_header): New arg specifying block ordinal.  All uses changed.
2720         Print link as 'h' type.  Give labels for long links and names.
2721
2722         * src/misc.c (contains_dot_dot): Moved to names.c
2723         (must_be_dot_or_slash): New function.
2724         (safer_rmdir): Use it.
2725         (remove_any_file): Now takes enum as option, not boolean.
2726         Check for (Linux) EISDIR as well as (POSIX) EPERM when attempting
2727         to unlink a directory.
2728         (deref_stat): Accept bool, not int.
2729
2730         * src/names.c (namelist_match): Allow partial matches only if
2731         recursive.
2732         (hash_string_hasher): Renamed from hash_avoided_name.
2733         (hash_string_compare): Renamed from compare_avoided_anames.
2734         (hash_string_insert, hash_string_lookup): New functions.
2735         (add_avoided_name, is_avoided_name): Use them.
2736         (safer_name_suffix): New function.
2737         (contains_dot_dot): Moved here from misc.c.  Now returns bool, not int.
2738
2739         * src/rmt.c: Don't include print-copyr.h.
2740         (prepare_input_buffer): New arg FD.
2741         Do not read more than INT_MAX bytes at once,
2742         since it breaks on some brain damaged Tru64 hosts.
2743         Divide size by two
2744         when retrying instead of subtracting 1024; for speed.
2745         (main): Use gettext to translate (C), not print_copyright.
2746
2747         * src/system.h: Include <alloca.h> and <stdbool.h> unconditionally,
2748         now that gnulib handles this.
2749         Include <stddef.h> and <limits.h> unconditionally, now that we assume
2750         C89 or better.
2751         Assume that offsetof is defined in stddef.h.
2752         Do not include <sys/param.h>.
2753         (realloc, lseek): Do not declare.
2754         (HAVE_DECL_VALLOC): Renamed from HAVE_VALLOC.
2755         (CHAR_BIT, CHAR_MAX, UCHAR_MAX, LONG_MAX): Remove
2756         declarations, since we now assume C89 or better.
2757         (PARAMS): Remove, as we now assume C89.  All uses changed.
2758         (bindtextdomain, textdomain): Include <gettext.h> to define.
2759         Include <unlocked-io.h>.
2760         (valloc): Define if not defined, and if valloc is not declared.
2761         (xstrdup): Remove decl.
2762
2763         * src/tar.c: Do not include <print-copyr.h>.
2764         Include <getdate.h>.
2765         (get_date): Remove decl.
2766         (ATIME_PRESERVE_OPTION, CHECKPOINT_OPTION, FORCE_LOCAL_OPTION,
2767         IGNORE_FAILED_READ_OPTION, INDEX_FILE_OPTION, NO_OVERWRITE_DIR_OPTION,
2768         NUMERIC_OWNER_OPTION, RECURSIVE_UNLINK_OPTION, REMOVE_FILES_OPTION,
2769         SHOW_OMITTED_DIRS_OPTION, TOTALS_OPTION): New constants.
2770         (long_options, decode_options): Use them.
2771         (OVERWRITE_DIR_OPTION): Remove.
2772         (long_options): New options --index-file, --no-overwrite-dir.
2773         Remove --overwrite-dir option.
2774         (usage): Use PACKAGE_BUGREPORT.
2775         (decode_options): Terminate new argv properly.
2776         Use PACKAGE_NAME, PACKAGE_VERSION.
2777         If verbose, report how we grokked any textual date option.
2778         (main): Add support for index-file.
2779
2780         * tests/Makefile.am: Convert to UTF-8.
2781         (AUTOMAKE_OPTIONS): Remove.
2782         (TESTS): Add delete04.sh, multiv01.sh, options.sh.
2783         (INCLUDES): Remove ../intl.
2784         (LDADD): Don't link libtar.a twice.
2785
2786         * tests/genfile.c: Convert to UTF-8.
2787         Don't include <print-copyr.h>.
2788         (DEFAULT_PATTERN): Renamed from DEFAULT.
2789         (ZEROS_PATTERN): Renamed from ZEROS.
2790         (main): Use gettext to translate (C), not print_copyright.
2791
2792 2003-07-04  Paul Eggert  <eggert@twinsun.com>
2793
2794         Revamp to meet current standards of autoconf, automake,
2795         gettext, and gnulib, and incorporate new translations.
2796
2797         * config/config.guess, config/config.sub, config/depcomp,
2798         config/install-sh, config/mdate-sh, config/missing,
2799         config/mkinstalldirs, config/texinfo.texi:
2800         Moved here from parent directory, or from doc.
2801         * config.hin: Renamed from config.h.in.
2802         * config/config.rpath: New file.
2803
2804         * intl: Remove this subdirectory.
2805
2806         * lib/fnmatch_.h: Renamed from lib/fnmatch.hin.
2807
2808         * lib/getstr.c, lib/getstr.h, lib/msleep.c, lib/print-copyr.c,
2809         lib/print-copyr.h, lib/readutmp.c, lib/rename.c, lib/stpcpy.c,
2810         lib/strstr.c, lib/strtoimax.c, lib/strtoll.c, lib/strtoull.c,
2811         lib/strtoumax.c, lib/unicodeio.c, lib/unicodeio.h,
2812         lib/xstrtoimax.c, m4/c-bs-a.m4, m4/ccstdc.m4, m4/check-decl.m4,
2813         m4/decl.m4, m4/jm-mktime.m4, m4/prereq.m4, m4/xstrtoimax.m4,
2814         stamp-h.in: Remove.
2815
2816         * lib/alloca_.h, lib/fnmatch_loop.c, lib/gettext.h, lib/pathmax.h,
2817         lib/safe-write.c, lib/safe-write.h, lib/stdbool_.h, lib/strcase.h,
2818         lib/stripslash.c, lib/unlocked-io.h, lib/xgetcwd.h, m4/alloca.m4,
2819         m4/backupfile.m4, m4/bison.m4, m4/chown.m4, m4/dirname.m4,
2820         m4/dos.m4, m4/exclude.m4, m4/fileblocks.m4, m4/ftruncate.m4,
2821         m4/getdate.m4, m4/getopt.m4, m4/hash.m4, m4/human.m4,
2822         m4/intdiv0.m4, m4/intmax_t.m4, m4/inttypes-pri.m4,
2823         m4/inttypes_h.m4, m4/isc-posix.m4, m4/lchown.m4, m4/lib-ld.m4,
2824         m4/lib-link.m4, m4/lib-prefix.m4, m4/memset.m4, m4/mktime.m4,
2825         m4/modechange.m4, m4/nls.m4, m4/onceonly.m4, m4/pathmax.m4,
2826         m4/po.m4, m4/quote.m4, m4/quotearg.m4, m4/rmdir.m4,
2827         m4/safe-read.m4, m4/safe-write.m4, m4/save-cwd.m4, m4/savedir.m4,
2828         m4/ssize_t.m4, m4/stdbool.m4, m4/stdint_h.m4, m4/strcase.m4,
2829         m4/strtoimax.m4, m4/strtol.m4, m4/strtoll.m4, m4/strtoul.m4,
2830         m4/strtoull.m4, m4/strtoumax.m4, m4/tm_gmtoff.m4, m4/uintmax_t.m4,
2831         m4/unlocked-io.m4, m4/xalloc.m4, m4/xgetcwd.m4, m4/xstrtol.m4,
2832         po/LINGUAS, po/Makevars, po/Rules-quot, po/boldquot.sed,
2833         po/en@boldquot.header, po/en@quot.header, po/en_GB.po,
2834         po/insert-header.sin, po/remove-potcdate.sin, po/stamp-po: New files.
2835
2836         * ABOUT-NLS, INSTALL, lib/addext.c, lib/alloca.c, lib/argmatch.c,
2837         lib/argmatch.h, lib/backupfile.c, lib/backupfile.h, lib/dirname.c,
2838         lib/dirname.h, lib/error.c, lib/exclude.c, lib/exclude.h,
2839         lib/fnmatch.h, lib/full-write.c, lib/full-write.h, lib/getdate.h,
2840         lib/getdate.y, lib/getline.c, lib/getline.h, lib/getopt.c,
2841         lib/getopt.h, lib/getopt1.c, lib/hash.c, lib/hash.h, lib/human.c,
2842         lib/human.h, lib/lchown.c, lib/malloc.c, lib/mktime.c,
2843         lib/modechange.c, lib/modechange.h, lib/quote.c, lib/quote.h,
2844         lib/quotearg.c, lib/quotearg.h, lib/realloc.c, lib/safe-read.c,
2845         lib/safe-read.h, lib/save-cwd.c, lib/save-cwd.h, lib/savedir.c,
2846         lib/savedir.h, lib/strcasecmp.c, lib/utime.c, lib/xalloc.h,
2847         lib/xgetcwd.c, lib/xmalloc.c, lib/xstrdup.c, lib/xstrtol.c,
2848         lib/xstrtol.h, lib/xstrtoumax.c, m4/codeset.m4, m4/d-ino.m4,
2849         m4/error.m4, m4/fnmatch.m4, m4/getcwd.m4, m4/getline.m4, m4/gettext.m4,
2850         m4/glibc21.m4, m4/iconv.m4, m4/inttypes.m4, m4/lcmessage.m4,
2851         m4/longlong.m4, m4/malloc.m4, m4/mbrtowc.m4, m4/mbstate_t.m4,
2852         m4/progtest.m4, m4/realloc.m4, m4/strerror_r.m4, m4/ulonglong.m4,
2853         m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4, m4/xstrtoumax.m4,
2854         po/Makefile.in.in:
2855         Upgrade to latest version from external source.  The file "bootstrap"
2856         now grabs these automatically, so we needn't keep track of them
2857         in this change long any longer.
2858
2859         * Makefile.am (AUTOMAKE_OPTIONS): Remove.  Now done by configure.ac.
2860         (SUBDIRS): Remove intl.
2861         * PORTS: Update for star, Macintosh.
2862         * README, README-alpha: Suggest Autoconf 2.57, Automake 1.7.5,
2863         Bison 1.875, gettext 0.12.1.
2864         * THANKS: Add Bernhard Rosenkraenzer, Solar Designer.
2865         * configure.ac (AC_INIT, AM_INIT_AUTOMAKE): Convert to modern form.
2866         (AC_CONFIG_AUX_DIR): New.
2867         (AC_CONFIG_HEADERS): Rename config.h.in to config.hin, to be more
2868         like coreutils.
2869         (AC_PREREQ): Bump from 2.52 to 2.57.
2870         (AC_GNU_SOURCE): New.
2871         (AC_PROG_GCC_TRADITIONAL, AM_C_PROTOTYPES, AC_C_CONST): Remove;
2872         we no longer support K&R C.
2873         (YACC): Remove.
2874         (AC_CHECK_HEADERS): Remove limits.h, poll.h, stdbool.h, stropts.h,
2875         sys/ioccom.h, sys/param.h, sys/time.h, sys/timeb.h, wchar.h, wctype.h.
2876         (AC_MBSTATE_T): Remove.
2877         (HAVE_UTIME_H, HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
2878         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
2879         HAVE_DECL_STRTOULL, HAVE_MKNOD): Remove our special code.
2880         (AM_STDBOOL_H): Add.
2881         (AC_HEADER_TIME, AC_STRUCT_TIMEZONE,
2882         jm_CHECK_TYPE_STRUCT_DIRENT_D_INO): Remove.
2883         (AC_CHECK_TYPE): Remove ssize_t.
2884         (gt_TYPE_SSIZE_T): Add.
2885         (jm_AC_PREREQ_XSTRTOUMAX, jm_PREREQ_ADDEXT, jm_PREREQ_ERROR,
2886         jm_PREREQ_HUMAN, jm_PREREQ_QUOTEARG, jm_PREREQ_XGETCWD,
2887         AC_FUNC_ALLOCA, AC_FUNC_CLOSEDIR_VOID, AC_FUNC_STRERROR_R,
2888         AC_FUNC_FNMATCH, AC_FUNC_VPRINTF, AM_FUNC_GETLINE, jm_FUNC_MALLOC,
2889         jm_FUNC_MKTIME, jm_FUNC_REALLOC):
2890         Remove.  Switch to gnulib macros like gl_BACKUPFILE instead.
2891         (tar_LDADD): Rename to LIB_CLOCK_GETTIME.  All uses changed.
2892         (rmt_LDADD): Rename to LIB_SETSOCKOPT.  All uses changed.
2893         (AC_CHECK_FUNCS): Remove fchdir, ftime, getcwd, isascii, nap,
2894         napms, poll, select, strstr, usleep.
2895         (AC_REPLACE_FUNCS): Remove ftruncate, lchown, memset, rename,
2896         rmdir, strcasecmp, strncasecmp, strtol, strtoul.
2897         (AM_GNU_GETTEXT): Use external and need-ngettext options.
2898         (AM_GNU_GETTEXT_VERSION): New.
2899         (AC_OUTPUT): Remove intl/Makefile.
2900
2901         * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2902         ($(srcdir)/tar.info, tar.dvi): Remove obsolete warnings.
2903         * doc/fdl.texi: Update to current GNU version.
2904         * doc/gettext.texi: Update to current coreutils version,
2905         plus a copyright notice.
2906         * doc/tar.texi: Switch to new method for doing copyright notices.
2907         Use @acronym instead of @sc where appropriate.
2908         Remove empty examples.  Give a few more examples.
2909
2910         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2911         (EXTRA_DIST, libtar_a_SOURCES): Switch to gnulib, so that they
2912         are built up in pieces with +=.
2913         (noinst_HEADERS, INCLUDES): Remove.
2914         (BUILT_SOURCES, MAINTAINERCLEANFILES, MOSTLYCLEANFILES): New.
2915         (libtar_a_LIBADD): Use $ rather than @.
2916         (all-local, alloca.h, fnmatch.h, stdbool.h): New rules, from gnulib.
2917
2918         * m4/Makefile.am (EXTRA_DIST): Add alloca.m4, backupfile.m4,
2919         bison.m4, chown.m4, dirname.m4, dos.m4, exclude.m4, fileblocks.m4,
2920         ftruncate.m4, getdate.m4, getopt.m4, hash.m4, human.m4,
2921         intdiv0.m4, intmax_t.m4, inttypes_h.m4, inttypes-pri.m4,
2922         isc-posix.m4, lcown.m4, lib-ld.m4, lib-link.m4, lib-prefix.m4,
2923         memset.m4, mktime.m4, modechange.m4, nls.m4, onceonly.m4,
2924         pathmax.m4, po.m4, quotearg.m4, quote.m4, rmdir.m4, safe-read.m4,
2925         safe-write.m4, save-cwd.m4, savedir.m4, ssize_t.m4, stdbool.m4,
2926         stdint_h.m4, strcase.m4, strtoimax.m4, strtoll.m4, strtol.m4,
2927         strtoull.m4, strtoul.m4, strtoumax.m4, tm_gmtoff.m4, uintmax_t.m4,
2928         unlocked-io.m4, xalloc.m4, xgetcwd.m4, xstrtol.m4.
2929         Remove c-bs-a.m4, ccstdc.m4, check-decl.m4, decl.m4, jm-mktime.m4,
2930         prereq.m4, xstrtoimax.m4.
2931
2932         * po/POTFILES.in: Remove tests/genfile.c; it doesn't need to
2933         be translated, since it's not a user-visible tool.
2934
2935         * scripts/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2936
2937         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2938         (INCLUDES): Remove ../intl.  Put top-srcdir before ., for
2939         consistency with coreutils.
2940         (LDADD): Link LIBINTL after libtar.a, since
2941         it's now external and should stand by itself.
2942
2943         * src/buffer.c (print_total_written): Adjust to new human.h
2944         interface.
2945         (child_open_for_compress): Do not increase size to BLOCKSIZE.
2946         (open_archive): Open index file name.
2947         Strip trailing slahes from file names.
2948         (flush_write): Set size to 0 if not saving names.
2949         (flush_write, flush_read): Use safer_name_suffix rather than
2950         inline code.
2951
2952         * src/common.h: Include <quote.h>.
2953         (absolute_names_option, atime_preserve_option, backup_option,
2954         block_number_option, checkpoint_option, dereference_option,
2955         force_local_option, ignore_failed_read_option, ignore_zeros_option,
2956         incremental_option, interactive_option, multi_volume_option,
2957         numeric_owner_option, one_file_system_option, recursive_unlink_option,
2958         read_full_records_option, remove_files_option, same_order_option,
2959         show_omitted_dirs_option, sparse_option, starting_file_option,
2960         to_stdout_option, totals_option, touch_option, verify_option,
2961         dev_null_output, now_verifying, we_are_root): Now bool, not int.
2962         (current_trailing_slash, index_file_name, recent_long_name_blocks,
2963         recent_long_link_blocks): New vars.
2964         (NO_OVERWRITE_DIR_OLD_FILES): New constant.
2965         (OVERWRITE_OLD_DIRS): Remove.
2966         (enum remove_option): New enum.
2967         (remove_any_file): Use it as option arg, not int.
2968         (is_avoided_name, contains_dot_dot): Return bool, not int.
2969         (safer_name_suffix): New decl.
2970
2971         * src/compare.c (now_verifying): Now bool, not int.
2972         (fill_in_sparse_array): Move to extract.c.  Now returns bool;
2973         all callers changed to test for failure.
2974         (diff_sparse_files): Take size from current_stat, not from param.
2975         (diff_archive): Do not count trailing slashes in archives.
2976         (verify_volume): Test for header failure after loop, not before.
2977
2978         * src/create.c (relativize): Remove; replaced by safer_name_suffix.
2979         All callers changed.
2980         (start_header): Clear devmajor and devminor fields, too.
2981         (finish_header): New arg block_ordinal.
2982         (init_sparsearray): Now extern.  Set sp_array_size to
2983         SPARSES_IN_OLDGNU_HEADER if it is zero.
2984         (dump_file): Keep link table as a hash.
2985         Do not count "file changed as we read it" as a failure.
2986
2987         * src/delete.c (recent_long_name_blocks, recent_long_link_blocks):
2988         Move extern decl to common.h.
2989
2990         * src/extract.c (we_are_root): Now bool, not int.
2991         (check_time): Warn about implausibly old time stamps.
2992         (set_stat): Use utimbuf, not stat_info.
2993         (prepare_to_extract): New arg DIRECTORY.
2994         (fill_in_sparse_array): Moved here from compare.c.
2995         (extract_sparse_file): Now returns off_t, giving size left.
2996         Truncate file at end.
2997         (extract_archive): Use safer_name_suffix rather than rolling our own.
2998         Use fill_in_sparse_array rather than rolling our own.
2999         Strip trailing slashes more effectively.
3000         Check for unsafe names.
3001
3002         * src/incremen.c (struct directory): nfs and found are now of type
3003         bool, not int.
3004         (gnu_restore): Now takes directory name as argument, not offset
3005         of directory name in a global.  All uses changed.
3006         (CURRENT_FILE_NAME): Remove.
3007
3008         New tests.
3009         * tests/delete04.sh, tests/multiv01.sh, tests/options.sh: New
3010         files.
3011
3012 2002-09-30  Paul Eggert  <eggert@twinsun.com>
3013
3014         * src/rmt.c (prepare_input_buffer): Renamed form
3015         prepare_record_buffer.  All uses changed.  Do not assume that
3016         size_t is the same width as int.
3017
3018 2002-03-29  Paul Eggert  <eggert@twinsun.com>
3019
3020         * src/incremen.c (get_directory_contents):
3021         If ignore_failed_read_option, only warn about
3022         get_directory_contents failures.  Fix suggested by
3023         Mark Costlow.
3024
3025 2002-01-31  Mark W. Eichin  <eichin@thok.org>
3026
3027         * src/buffer.c (child_open_for_compress): Don't try to read
3028         past the end of the buffer.
3029
3030 2001-10-11  Jim Meyering  <meyering@lucent.com>
3031
3032         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
3033         and quote_n (1, ... to avoid clobbering a buffer.
3034
3035 2001-09-26  Paul Eggert  <eggert@twinsun.com>
3036
3037         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.25.
3038
3039         * src/buffer.c (flush_read): Don't diagnose partial blocks before
3040         end of file; just ignore them silently.
3041
3042         * src/list.c (read_header): Don't keep around extended name
3043         and link info indefinitely; keep it only for the next file.
3044         This fixes a bug introduced in 1.13.24, and removes the need
3045         for some static variables.  Set recent_long_name and
3046         recent_long_link to zero if there were no long links; this
3047         avoids a violation of ANSI C rules for pointers in delete.c.
3048         * THANKS: Add Christian Laubscher.
3049
3050 2001-09-26  Jim Meyering  <meyering@lucent.com>
3051
3052         * doc/tar.texi (Remote Tape Server): is know -> is known
3053
3054 2001-09-25  Paul Eggert  <eggert@twinsun.com>
3055
3056         * lib/unicodeio.c (EILSEQ): Include <iconv.h> first, since
3057         <iconv.h> may define EILSEQ (e.g. libiconv).  Define a
3058         replacement EILSEQ to be ENOENT, not EINVAL, since callers may
3059         want to distinguish EINVAL and EILSEQ.
3060
3061 2001-09-24  Christophe Kalt  <Christophe.Kalt@kbcfp.com>
3062
3063         * src/extract.c (maybe_recoverable):
3064         Treat OVERWRITE_OLD_DIRS like DEFAULT_OLD_FILES.
3065
3066 2001-09-22  Paul Eggert  <eggert@twinsun.com>
3067
3068         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.24.
3069
3070         * ABOUT-NLS, intl/*: Update to gettext-0.10.40, replacing LGPL
3071         with GPL.
3072
3073         * INSTALL, mkinstalldirs: Update to autoconf 2.52 version.
3074         * PORTS: Add copyright notice, 'star' reference.
3075         * README-alpha: Add copyright notice, autoconf 2.52 patch.
3076         * THANKS: Add Christophe Kalt.
3077         * config.sub: Upgrade to 2001-09-14 version.
3078
3079         * configure.ac (ALL_LINGUAS): Add ko.
3080         * po/ko.po: Resurrected file.
3081
3082         * doc/convtexi.pl: Add coding advice for Emacs.
3083
3084         * doc/getdate.texi: Add copyright notice.
3085
3086         * doc/mdate-sh: Upgrade to automake 1.5 version.
3087
3088         * doc/tar.texi (extracting files): Mention --to-stdout.
3089         (Option Summary, Dealing with Old Files): New option --overwrite-dir.
3090         (Overwrite Old Files): Likewise.
3091
3092         * lib/Makefile.am (noinst_HEADERS):
3093         Remove copysym.h.  Add print-copyr.h, unicodeio.h.
3094         (libtar_a_SOURCES): Remove copysym.c, Add print-copyr.c, unicodeio.c.
3095
3096         * lib/copysym.c, lib/copysym.h: Remove.
3097         * lib/print-copyr.c, lib/print-copyr.h, lib/unicodeio.c,
3098         lib/unicodeio.h: New files.
3099
3100         * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
3101         lib/mktime.c, lib/strtoll.c: Switch from LGPL to GPL.
3102
3103         * lib/quotearg.c (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
3104         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
3105
3106         * m4/Makefile.am (EXTRA_DIST): Remove isc-posix.m4.
3107         * m4/isc-posix.m4: Remove.
3108
3109         * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit.
3110
3111         * po/POTFILES.in: Add copyright notice.
3112
3113         * src/Makefile.am (LDADD): Like libtar.a before @INTLLIBS@ as
3114         well as after.
3115         * tests/Makefile.am (LDADD): Likewise.
3116
3117         * src/buffer.c (write_archive_buffer, close_archive):
3118         If an archive is a socket, treat it like a FIFO.
3119         (records_read, records_written): New vars.
3120         (write_archive_to_stdout): Now bool, not int.
3121         (open_archive, flush_write, flush_read): Keep records_read and
3122         records_written up to date.
3123
3124         * src/common.h (enum old_files): New value OVERWRITE_OLD_DIRS.
3125         (write_archive_to_stdout): Now bool, not int.
3126         (enum read_header): New value HEADER_SUCCESS_EXTENDED.
3127         (read_header): Now takes bool arg.  Existing callers modified
3128         to pass 0, unless otherwise specified.
3129
3130         * src/delete.c (records_read): Remove; now a global.
3131         (acting_as_filter): Now bool, not int.
3132         (recent_long_name, recent_long_link, recent_long_name_blocks,
3133         recent_long_link_blocks, records_read, records_written): New decls.
3134         (records_skipped): New var.
3135         (move_archive): Don't divide by zero if arg is 0.
3136         Use the above vars to compute how far to move.
3137         (write_recent_blocks): New function.
3138         (delete_archive_member): Pass 1 to read_header, so that it doesn't
3139         read more than 1 block.  Handle resulting HEADER_SUCCESS_EXTENDED code.
3140         Keep track of how many records have been skipped.
3141         Let the buffer code count records.
3142         When copying a header, copy any extended headers that came before it.
3143
3144         * src/extract.c (extract_archive): When marking a directory to be
3145         updated after symlinks, stat all directories after it in the
3146         delayed-set-stat list too, since they will be checked after
3147         symlinks.  Add support for --overwrite-dir.
3148
3149         * src/list.c (recent_long_name, recent_long_link,
3150         recent_long_name_blocks, recent_long_link_blocks): New vars.
3151         (read_and): Pass 0 to read_header.
3152         (read_header): New arg RAW_EXTENDED_HEADERS.  Store away extended
3153         headers into new vars.  Null-terminate incoming symbolic links.
3154
3155         * src/rmt.c: Include print-copyr.h, not copysym.h.
3156         (main): Use print_copyright, not copyright_symbol.
3157         * src/tar.c (decode_options): Likewise.
3158         (OVERWRITE_DIR_OPTION): New constant.
3159         (long_options, usage, decode_options): Add --overwrite-dir.
3160
3161         * src/tar.h: Put copyright notice into documentation.
3162
3163         * tests/Makefile.am (TESTS): Add delete03.sh.
3164         * tests/delete03.sh: New file.
3165
3166         * tests/genfile.c: Include print-copyr.h, not copysym.h.
3167         (main): Use print_copyright, not copyright_symbol.
3168         Include <argmatch.h>.
3169         (pattern_strings): Remove.
3170         (pattern_args, pattern_types): New constants.
3171         (main): Use XARGMATCH, not argmatch.
3172
3173 2001-09-20  Jim Meyering  <meyering@lucent.com>
3174
3175         * lib/xstrtol.c (strtoimax): Guard declaration with
3176         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
3177         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
3178         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
3179         (strtoumax): Likewise, for completeness (it wasn't necessary).
3180         * m4/xstrtoimax.m4 (jm_AC_PREREQ_XSTRTOIMAX):
3181         Check for declaration of strtoimax.
3182         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
3183         Check for declaration of strtoumax.
3184
3185 2001-09-16  Paul Eggert  <eggert@twinsun.com>
3186
3187         * fnmatch.m4 (jm_FUNC_FNMATCH): Fix typo in previous patch: yes -> no.
3188
3189 2001-09-14  Paul Eggert  <eggert@twinsun.com>
3190
3191         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.23.
3192
3193         * README-alpha: Describe automake patch.
3194
3195         * configure.ac (LIBOBJS):
3196         Remove automake 1.4 workaround, as we're using 1.5 now.
3197         (USE_INCLUDED_LIBINTL): New AC_DEFINE.
3198
3199         * lib/copysym.c: Include stddef.h, for size_t.
3200         Include langinfo.h if needed.
3201         Use locale_charset only if USE_INCLUDED_LIBINTL;
3202         if not, use nl_langinfo (CODESET) if available.
3203
3204 2001-09-13  Paul Eggert  <eggert@twinsun.com>
3205
3206         * config.guess, config.sub: Sync with canonical versions.
3207
3208         * configure.ac (jm_PREREQ_XGETCWD): Add.
3209
3210         * lib/Makefile.am (noinst_HEADERS): Add copysym.h.
3211         (libtar_a_SOURCES): Add copysym.c.
3212         * copysym.c, copysym.h: New files.
3213
3214         * lib/error.c: Sync with fileutils version.
3215
3216         * m4/Makefile.am (EXTRA_DIST): Add getcwd.m4; remove uintmax_t.m4.
3217         * m4/getcwd.m4: New file.
3218         * m4/uintmax_t.m4: Remove.
3219
3220         * m4/gettext.m4 (AM_WITH_NLS):
3221         Fix bug with calculating version of Bison 1.29.
3222         Reported by Karl Berry.
3223
3224         * src/Makefile.am (datadir): Remove.
3225
3226         * src/rmt.c: Include copysym.h.
3227         (main): Use copyright_symbol to translate copyright notice,
3228         instead of gettext.
3229         * src/tar.c: Likewise.
3230         * tests/genfile.c: Likewise.
3231
3232         * src/system.h (MB_LEN_MAX): New symbol.
3233
3234 2001-09-11  Paul Eggert  <eggert@twinsun.com>
3235
3236         * src/extract.c (struct delayed_set_stat): New member
3237         'after_symlinks'.
3238         (delay_set_stat): Initialize it to 0.
3239         (set_mode): New arg current_stat_info.  Use it (if nonnull) to avoid
3240         taking an extra stat ourselves.  All callers changed.
3241         (set_stat): Likewise.
3242         (apply_nonancestor_delayed_set_stat): New arg 'after_symlinks'.
3243         If false, stop when encountering a struct whose 'after_symlinks'
3244         member is true.  Otherwise, go through all structures but check
3245         them more carefully.  All callers changed.
3246         (extract_archive): When extracting a deferred symlink, if its parent
3247         directory's status needs fixing, then mark the directory as needing
3248         to be fixed after symlinks.
3249         (extract_finish): Fix status of ordinary directories, then apply
3250         delayed symlinks, then fix the status of directories that are
3251         ancestors of delayed symlinks.
3252
3253         * src/rtapelib.c (rexec):
3254         Remove declaration; it ran afoul of prototypes on Crays.
3255         Reported by Wendy Palm of Cray.
3256
3257 2001-09-06  Paul Eggert  <eggert@twinsun.com>
3258
3259         * lib/strtoimax.c (HAVE_LONG_LONG):
3260         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
3261         (strtoimax): Use sizeof (long), not
3262         sizeof strtol (ptr, endptr, base),
3263         to work around bug in IBM C compiler.
3264
3265 2001-09-04  Paul Eggert  <eggert@twinsun.com>
3266
3267         * lib/xgetcwd.c: Include "xalloc.h".
3268         (xgetcwd): Do not return NULL when memory is exhausted; instead,
3269         report an error and exit.
3270
3271         * m4/prereq.m4 (jm_PREREQ_XREADLINK): New macro.
3272         (jm_PREREQ): Use it.
3273
3274 2001-09-03  Paul Eggert  <eggert@twinsun.com>
3275
3276         * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_XGETCWD.
3277         (jm_PREREQ_XGETCWD): New macro.
3278
3279         * lib/exclude.c (fnmatch_no_wildcards):
3280         Fix typo that caused us to do case-folding
3281         search even when that was not desired.  This occurred only in the
3282         no-wildcard case.
3283
3284         * lib/xgetcwd.c: Include pathmax.h if not HAVE_GETCWD.
3285         Do not include xalloc.h.
3286         (INITIAL_BUFFER_SIZE): New symbol.
3287         Do not use xmalloc / xrealloc, since the caller is responsible for
3288         handling errors.  Preserve errno around `free' during failure.
3289         Do not overrun buffer when using getwd.
3290
3291         * lib/xgetcwd.c (xgetcwd):
3292         Use HAVE_GETCWD_NULL, not defined __GLIBC__ && __GLIBC__ >= 2,
3293         to decide whether to use getcwd (NULL, 0).
3294
3295 2001-09-02  Paul Eggert  <eggert@twinsun.com>
3296
3297         * lib/xgetcwd.c: Fix typo in local var; from Jim Meyering.
3298
3299 2001-09-01  Jim Meyering  <meyering@lucent.com>
3300
3301         * exclude.c: Use `""', not `<>' to #include non-system header files.
3302         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
3303         and strncasecmp as r-values.  Unixware didn't have declarations.
3304
3305 2001-08-31  Jim Meyering  <meyering@lucent.com>
3306
3307         * lib/xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
3308         Use an initial, malloc'd, buffer of length 128 rather than
3309         a statically allocated one of length 1024.
3310
3311 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3312
3313         * lib/utime.c: Include full-write.h.
3314         * lib/xstrtol.c (strtoimax): New decl.
3315
3316 2001-08-29  Paul Eggert  <eggert@twinsun.com>
3317
3318         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.22.
3319
3320         * src/create.c (dump_file): Relativize link names before dumping.
3321         This fixes a bug reported by Jose Pedro Oliveira.
3322
3323         * src/create.c (dump_file): Use offsetof when computing sizes for
3324         struct hack; this avoids wasted space in some cases.
3325         * src/incremen.c (note_directory, find_directory): Likewise.
3326         * src/names.c (name_gather, addname): Likewise.
3327
3328         * src/extract.c (extract_archive): Use strcpy, not memcpy,
3329         for consistency with other code that does similar things.
3330         * src/names.c (name_gather): Likewise.
3331
3332         * src/names.c (read_name_from_file, name_next, name_gather,
3333         add_hierarchy_to_namelist): Avoid quadratic behavior when
3334         reallocating buffers.  Check for buffer size overflow.
3335         (addname): Avoid unnecessary clearing of memory.
3336
3337 2001-08-29  "Jan D."  <Jan.Djarv@mbox200.swipnet.se>
3338
3339         * src/extract.c (delay_set_stat): Fix off-by-one error in file
3340         name size allocation that caused core dumps.
3341
3342 2001-08-28  Paul Eggert  <eggert@twinsun.com>
3343
3344         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.21.
3345
3346         * configure.ac (GNU_SOURCE): Define to 1, not /**/.
3347         (major_t, minor_t, ssize_t): Use new-style AC_CHECK_TYPE.
3348         (daddr_t): Remove; no longer used.
3349         (jm_PREREQ_HUMAN): Add.
3350
3351         * acconfig.h: Remove; no longer needed.
3352
3353         * config.guess, config.sub:
3354         New files, from automake 1.5.  Gettext 0.10.39 needs them.
3355         * depcomp, missing, mkinstalldirs: Upgrade to automake 1.5.
3356
3357         * Makefile.am (AUTOMAKE_OPTIONS): Add dist-bzip2.
3358         (SUBDIRS): Put intl before lib, as gettext requires.
3359
3360         * ABOUT-NLS: Upgrade to gettext 0.10.39.
3361         * intl: Upgrade entire directory to gettext 0.10.39.
3362         * m4/codeset.m4, m4/glibc21.m4, m4/iconv.m4:
3363         New files, from gettext 0.10.39.
3364         * m4/gettext.m4, m4/isc-posix.m4, m4/lcmessage.m4, m4/progtest.m4,
3365         Upgrade to gettext 0.10.39,
3366         * po/Makefile.in.in: Likewise, except fix a typo in its copying
3367         permissions.
3368         * po/cat-id-tbl.c, po/stamp-cat-id:
3369         Remove; no longer used by gettext 0.10.39.
3370         * po/ChangeLog: New file.
3371
3372         * doc/Makefile.am (EXTRA_DIST): Add freemanuals.texi.
3373         $(srcdir)/tar.texi: Likewise.
3374         * doc/freemanuals.texi: New file.
3375         * doc/tar.texi (Free Software Needs Free Documentation): New appendix.
3376         `fileds' -> `fields'
3377         * doc/texinfo.tex: Upgrade to version 2001-07-25.07.
3378
3379         * lib/Makefile.am (EXTRA_DIST): Add strtoll.c, strtoimax.c.
3380         (noinst_HEADERS): Add quote.h.
3381         (libtar_a_SOURCES): Add quote.c, xstrtoimax.c.
3382
3383         * lib/exclude.c: Fix typo in '#include <stdint.h>' directive.
3384
3385         * lib/full-write.c, lib/savedir.c: Comment fix.
3386
3387         * lib/pathmax.h: Remove.
3388
3389         * lib/quote.c, lib/quote.h: New files.
3390
3391         * lib/xgetcwd.c: Don't include pathmax.h.
3392         Include stdlib.h and unistd.h if available.
3393         Include xalloc.h.
3394         (xmalloc, xstrdup, free): Remove decls.
3395         (xgetcwd): Don't assume sizes fit in unsigned.
3396         Check for overflow when computing sizes.
3397         Simplify reallocation code.
3398
3399         * lib/xmalloc.c: Quote failure tests.
3400
3401         * lib/strtoumax.c, lib/xstrtoimax.c: New files.
3402
3403         * lib/strtoimax.c: Renamed from strtouxmax.c.  Make it more
3404         similar to strtol.c.
3405         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.
3406         (verify): New macro.
3407         (strtoumax, uintmax_t, strtoull, strtol): Remove.
3408         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
3409         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
3410         changed to signed values.  Check sizes at compile-time, not
3411         run-time.  Prefer strtol to strtoll if both work.
3412         (main): Remove.
3413
3414         * lib/xstrtol.h (xstrtoimax): New decl.
3415
3416         * m4/Makefile.am (EXTRA_DIST):
3417         Add codeset.m4, glibc21.m4, iconv.m4, inttypes.m4,
3418         longlong.m4, xstrtoimax.m4.
3419
3420         * m4/inttypes.m4 (jm_AC_HEADER_INTTYPES_H):
3421         Remove; now done by autoconf.
3422         (jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Replace with
3423         Use AC_CHECK_TYPE instead of merely looking for the header.
3424
3425         * m4/uintmax_t.m4: Use shorter comment.
3426
3427         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
3428         Quote first arg of AC_DEFUN.
3429         Require jm_AC_TYPE_INTMAX_T and jm_AC_TYPE_LONG_LONG since they
3430         is needed to parse the include file.
3431         Simplify logic behind the args to AC_REPLACE.
3432
3433         * src/Makefile.am (OMIT_DEPENDENCIES): Remove.
3434
3435         * src/ansi2knr.1, src/ansi2knr.c: Remove; wasn't being used.
3436
3437         * src/rmt.c (main):
3438         Use "Copyright %d" to simplify the translator's job in the future.
3439         Advise translator about circle-C.
3440         * src/tar.c: (decode_options): Likewise.
3441         * tests/genfile.c (main): Likewise.
3442
3443 2001-08-28  Jim Meyering  <meyering@lucent.com>
3444
3445         * lib/argmatch.c: Include "quote.h".
3446         (argmatch_invalid): Quote the context.
3447
3448         * lib/dirname.c (dir_name): Fix typo on PC platforms.
3449
3450         * lib/backupfile.c, lib/basename.c, lib/dirname.c, lib/strtoul.c:
3451         Use single-quote for local .h files.
3452
3453         * lib/error.h (__attribute__): Don't depend on __STRICT_ANSI__.
3454
3455         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Upgrade to recent
3456         glibc versions.
3457
3458         * lib/getdate.y (get_date): Initialize tm_isdst to -1 before
3459         invoking mktime the last time.
3460
3461         * lib/pathmax.h: Use #if rather than #ifdef for HAVE_UNISTD_H.
3462
3463         * lib/rename.c: Major rewrite by Volker Borchert to use system
3464         rename function, but to work around problems with trailing
3465         slashes.
3466
3467         * lib/strtoll.c: New file, from glibc.
3468         * lib/strtoul.c: Update from glibc.
3469
3470         * lib/strtouxmax.c: Renamed from lib/strtoumax.c.
3471         Add support for signed numbers, too.
3472         (strtoul, strtoull): Do not declare if STRTOUXMAX_UNSIGNED
3473         is not defined.
3474         (strtol, strtoll): Declare as needed, if STRTOUXMAX_UNSIGNED is
3475         not defined.
3476         (strtoumax, uintmax_t, strtoull, strtoul): New macros.
3477         (main): Use generic names in debugging output.
3478         * lib/strtoimax.c: Plus add the following changes of my own:
3479         (main): Use accurate names in debugging output.
3480
3481         * lib/xgetcwd.c (xgetcwd): Use getcwd if glibc 2 or later.
3482         Don't use PATH_MAX.
3483
3484         * m4/c-bs-a.m4, m4/check-decl.m4, m4/d-ino.m4, m4/error.m4,
3485         m4/getline.m4, m4/jm-mktime.m4, m4/malloc.m4, m4/mbrtowc.m4,
3486         m4/mbstate_t.m4, m4/realloc.m4, m4/uintmax_t.m4, m4/utimbuf.m4,
3487         m4/utime.m4, m4/utimes.m4:
3488         Quote the first argument in each use of AC_DEFUN.
3489
3490         * m4/getline.m4: Don't use string.h.
3491
3492         * m4/inttypes.m4, m4/longlong.m4, m4/xstrtoimax.m4: New files.
3493
3494         * m4/mbrtowc.m4 (jm_FUNC_MBRTOWC): @%:@ -> #.
3495
3496 2001-08-27  Paul Eggert  <eggert@twinsun.com>
3497
3498         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.20.
3499
3500         The biggest change is the new --exclude semantics and options.
3501         The basic idea was suggested by Gerhard Poul; thanks!
3502
3503         * NEWS: Describe new --exclude semantics and options, and bug fixes.
3504         * README: ignfail.sh fails on some NFS hosts.
3505         * NEWS, README, lib/xstrtol.h: Add copyright notice.
3506
3507         * Makefile.am (ACLOCAL_AMFLAGS): Add -I m4.
3508         (M4DIR, ACINCLUDE_INPUTS, $(srcdir)/acinclude.m4):
3509         Remove; the automake bug has been fixed.
3510         * acinclude.m4: Remove.
3511
3512         * configure.ac: Renamed from configure.in.
3513         (AC_PREREQ): Bump from 2.13 to 2.52.
3514         (ALL_LINGUAS): Add id, tr.  Remove ko, as po/ko.po (dated
3515         1997-05-30) has an encoding error.
3516         (jm_AC_HEADER_INTTYPES_H): Remove; now done by autoconf.
3517         (AC_FUNC_FNMATCH): Use AC_CONFIG_LINKS, not AC_LINK_FILES.
3518
3519         * doc/fdl.texi: Update to current GNU version.
3520
3521         * doc/tar.texi: Put leading '*' in direntry.
3522         Accommodate new gfdl sectioning.
3523         New option --recursion (the default) that is the inverse of
3524         --no-recursion.
3525
3526         New options --anchored, --ignore-case, --wildcards,
3527         --wildcards-match-slash, and their negations (e.g., --no-anchored).
3528         Along with --recursion and --no-recursion, these control how exclude
3529         patterns are interpreted.  The default interpretation of exclude
3530         patterns is now --no-anchored --no-ignore-case --recursion
3531         --wildcards --wildcards-match-slash.
3532
3533         * lib/Makefile.am (OMIT_DEPENDENCIES): Remove.
3534
3535         * lib/exclude.c (bool): Declare, perhaps by including stdbool.h.
3536         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
3537         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
3538         Include if available.
3539         (<xalloc.h>): Include
3540         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
3541         (verify): New macro.  Use it to verify that EXCLUDE macros do not
3542         collide with FNM macros.
3543         (struct patopts): New struct.
3544         (struct exclude): Use it, as exclude patterns now come with options.
3545         (new_exclude): Support above changes.
3546         (new_exclude, add_exclude_file):
3547         Initial size must now be a power of two to simplify overflow checking.
3548         (free_exclude, fnmatch_no_wildcards): New function.
3549         (excluded_filename): No longer requires options arg, as the options
3550         are determined by add_exclude.  Now returns bool, not int.
3551         (excluded_filename, add_exclude):
3552         Add support for the fancy new exclusion options.
3553         (add_exclude, add_exclude_file): Now takes int options arg.
3554         Check for arithmetic overflow when computing sizes.
3555         (add_exclude_file): xrealloc might modify errno, so don't
3556         realloc until after errno might be used.
3557
3558         * lib/exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
3559         New macros.
3560         (free_exclude): New decl.
3561         (add_exclude, add_exclude_file): Now takes int options arg.
3562         (excluded_filename): No longer requires options arg, as the options
3563         are determined by add_exclude.  Now returns bool, not int.
3564
3565         * lib/prepargs.c: Include <string.h>; required for C99 since
3566         we use strlen.
3567
3568         * lib/quotearg.c:
3569         BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared.
3570
3571         * lib/xstrtol.h (_DECLARE_XSTRTOL): Improve quality of
3572         diagnostic for LONGINT_INVALID_SUFFIX_CHAR.
3573
3574         * m4/Makefile.am (EXTRA_DIST): Add check-decl.m4, mbrtowc.m4.
3575         Remove inttypes_h.m4, largefile.m4, mktime.m4.
3576
3577         * m4/inttypes_h.m4, m4/largefile.m4, m4/mktime.m4: Remove;
3578         subsumed by Autoconf 2.50.
3579
3580         * m4/error.m4: Upgrade to serial 2.
3581
3582         * m4/fnmatch.m4 (jm_FUNC_FNMATCH): Upgrade to serial 4, but
3583         remove test for GNU C library.  It's not correct, as some
3584         older glibcs are buggy.
3585
3586         * m4/getline.m4, m4/malloc.m4: Upgrade to serial 4.
3587
3588         * m4/prereq.m4: Upgrade to serial 20, but then:
3589         (jm_PREREQ): Add jm_PREREQ_EXCLUDE.
3590         (jm_PREREQ_EXCLUDE): New macro.
3591         (jm_PREREQ_HUMAN): Remove jm_AC_HEADER_INTTYPES_H, as it is subsumed
3592         by autoconf 2.5x.
3593
3594         * m4/realloc.m4: Upgrade to serial 4.
3595
3596         * m4/strerror_r.m4: Revert to serial 1002.
3597
3598         * m4/uintmax_t.m4: Upgrade to autoconf 2.5x.
3599
3600         * m4/utimes.m4: Upgrade to latest version (still "serial 3").
3601
3602         * m4/xstrtoumax.m4: Upgrade to serial 3, but then:
3603         (jm_AC_PREREQ_XSTRTOUMAX): Remove jm_AC_HEADER_INTTYPES_H, as
3604         it is now subsumed by autoconf.  Add inttypes.h.
3605
3606         * po/cs.po, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
3607         po/it.po, po/pl.po, po/sl.po, po/sv.po: Sync with translation project.
3608
3609         * src/buffer.c (new_volume): Stop if the script exits with an error.
3610
3611         * src/common.h (excluded_with_slash, excluded_without_slash):
3612         Remove, replacing by:
3613         (excluded): New decl.
3614         (link_error): New decl.
3615         (excluded_name): Now returns bool.
3616
3617         * src/extract.c:
3618         (struct delayed_symlinks, extract_archive, apply_delayed_symlinks):
3619         Support hard links to symbolic links.
3620
3621         (struct delayed_symlink): Remove 'names' member, replacing it with
3622         'sources' and 'target' member.  All uses changed.
3623
3624         (struct string_list): New type.
3625
3626         (delayed_set_stat, extract_archive): Use offsetof when computing sizes
3627         for struct hack; this avoids wasted space in some cases.
3628
3629         (extract_archive): Fix test for absolute pathnames and/or "..".
3630         Use link_error to report errors for links.
3631         Remove redundant trailing '/' at "really_dir", for all uses, not
3632         just before invoking mkdir.
3633         If overwriting old files, do not worry so much about existing
3634         directories.
3635         Fix mode computation in the case where the directory exists.
3636
3637         (apply_delayed_symlinks): If we can't make a hard link to a symbolic
3638         link, make a copy of the symbolic link.
3639
3640         * src/incremen.c (get_directory_contents):
3641         If ignore_failed_read_option, only warn about
3642         stat failures.
3643
3644         * src/list.c (from_header): Do not issue a diagnostic if TYPE is zero.
3645         However, check for error even for '-' or '+' case.
3646
3647         (print_header): Try parsing uids and gids as unsigned integers first,
3648         and as a uid_t or gid_t only if that fails.  This adds support for
3649         listing positive uids and gids that are greater than UID_MAX and
3650         GID_MAX.
3651
3652         * src/misc.c (link_error): New function.
3653
3654         * src/names.c (collect_and_sort_names):
3655         If ignore_failed_read_option, only warn about
3656         stat errors.
3657
3658         (excluded_name): Now returns bool.  Simplify, as the fancy
3659         features are now all in excluded_filename.
3660
3661         * src/rtapelib.c (base_name): Remove decl, as system.h now
3662         declares it.
3663
3664         * src/system.h: Include stddef.h if available.
3665         (offsetof): Declare if stddef.h doesn't.
3666
3667         Include <dirname.h>.
3668         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now defined by dirname.h.
3669
3670         * src/tar.c (ANCHORED_OPTION, IGNORE_CASE_OPTION,
3671         NO_ANCHORED_OPTION, NO_IGNORE_CASE_OPTION, NO_WILDCARDS_OPTION,
3672         NO_WILDCARDS_MATCH_SLASH_OPTION, WILDCARDS_OPTION,
3673         WILDCARDS_MATCH_SLASH_OPTION):
3674         New enum values.
3675
3676         (long_options, usage, decode_options): Add support for --anchored,
3677         --ignore-case, --no-anchored, --no-ignore-case, --no-wildcards,
3678         --no-wildcards-match-slash, --recursion, --wildcards,
3679         --wildcards-match-slash.
3680
3681         (decode_options): Implement the new way of interpreting exclude
3682         patterns.
3683
3684         (usage): --newer-mtime takes a DATE operand.  DATE may be a file name.
3685
3686         (OPTION_STRING, decode_options): Add -I, -y.  Currently these options
3687         just print error messages suggesting alternatives.
3688
3689         (add_filtered_exclude): Remove.
3690
3691         * tests/Makefile.am (TESTS): Alphabetize, except put version.sh first.
3692
3693         * tests/extrac04.sh (out): Remove
3694         directory/subdirectory/file1, as the new semantics for
3695         --exclude exclude it.
3696
3697         * tests/genfile.c (main): Don't use non-ASCII char in msgid.
3698
3699 2001-08-12  Paul Eggert  <eggert@twinsun.com>
3700
3701         * lib/addext.c (<errno.h>): Include.
3702         (errno): Declare if not defined.
3703         (addext): Work correctly on the Hurd, where pathconf returns -1 and
3704         leaves errno alone, because there is no limit.  Also, work even if
3705         size_t is narrower than long.
3706
3707 2001-07-08  Paul Eggert  <eggert@twinsun.com>
3708
3709         * lib/alloca.c (alloca): Arg is of type size_t, not unsigned.
3710
3711 2001-05-10  Paul Eggert  <eggert@twinsun.com>
3712
3713         * lib/addext.c (ISSLASH, base_name): Remove decls; now in dirname.h.
3714         Include <backupfile.h> and <dirname.h> after size_t is defined.
3715         (addext): Use base_len to trim redundant trailing slashes instead of
3716         doing it ourselves.
3717
3718         * lib/backupfile.c (ISSLASH, base_name):
3719         Remove decls; now in dirname.h.
3720         Include <argmatch.h>, <backupfile.h>, <dirname.h> after size_t
3721         is defined.
3722         (find_backup_file_name): Rename locals to avoid new functions.
3723         Use base_len instead of rolling it ourselves.
3724         Work even if dirlen is 0.
3725         Use a dir of '.' if given the empty string.
3726
3727         * lib/basename.c:
3728         Do not include <stdio.h>, <assert.h>; no longer needed.
3729         (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Remove; now in dirname.h.
3730         Include <string.h>, <dirname.h>.
3731         (base_name): Allow file names ending in slashes, other than names
3732         that are all slashes.  In this case, return the basename followed
3733         by the slashes.
3734
3735         * lib/dirname.c: Include <string.h> instead of <stdlib.h>.
3736         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now in dirname.h.
3737         (dir_len): Renamed from dirlen.
3738         All callers changed.
3739
3740         * lib/dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
3741         New macros.
3742         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
3743
3744 2001-02-16  Paul Eggert  <eggert@twinsun.com>
3745
3746         * lib/quotearg.c (mbrtowc, mbrtowc, mbsinit):
3747         Do not declare or define if HAVE_MBRTOWC,
3748         since the test for HAVE_MBRTOWC now requires proper declarations.
3749
3750         * lib/alloca.c (malloc): Undef before defining.
3751
3752 2001-02-13  Paul Eggert  <eggert@twinsun.com>
3753
3754         * src/compare.c (read_and_process): Use off_t for size.
3755         From Maciej W. Rozycki.
3756
3757 2001-01-26  Paul Eggert  <eggert@twinsun.com>
3758
3759         * lib/quotearg.c: Include stddef.h.  From Jim Meyering.
3760
3761 2001-01-12  Paul Eggert  <eggert@twinsun.com>
3762
3763         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.19.
3764
3765         * lib/savedir.h (savedir): Remove size arg.
3766
3767         * doc/tar.texi: Add @setchapternewpage odd.
3768         Remove -I as an alias for -T, for now.
3769         Add @dircategory.
3770         Update copyright.  Remove "Published by".
3771         Dates beginning with / or . are taken to be file names.
3772
3773         * src/tar.c (<time.h>): Do not include;
3774         (time): Do not declare.
3775         (usage): Remove -I as an alias for -T.
3776         (OPTION_STRING): Remove -I.
3777         (decode_options): Dates that look like an absolute path name,
3778         or that start with '.', are presumed to be file names whose
3779         dates are taken.
3780         Remove 'I' as an aliase for 'T'.
3781         Update copyright.
3782
3783         * src/extract.c (<time.h>): Do not include; system.h now does this.
3784         (make_directories): Skip filesystem prefixes.
3785         Don't assume '/' is the only separator.
3786         (extract_sparse_file): Use new full_write semantics.
3787         On write error, return instead of invoking skip_file.
3788         Do not free sparsearray; caller does this now.
3789         (apply_nonancestor_delayed_set_stat): Do not assume '/' is the only
3790         separator.
3791         (extract_archive): Don't assume file name lengths fit in int.
3792         Report what got stripped from member name; it might be more than '/'.
3793         Use new full_write semantics.
3794         Do not pass redundant trailing "/" to mkdir, as POSIX does not allow
3795         mkdir to ignore it.
3796         Do not report mkdir error if old_files_option == KEEP_OLD_FILES.
3797
3798         * src/buffer.c (<time.h>): Do not include; system.h now does this.
3799         (time): Remove decl; likewise.
3800         (child_open_for_uncompress): Use new full_write semantics.
3801         (flush_write): Use ISSLASH instead of testing for '/'.
3802         (flush_read): Likewise.
3803
3804         * src/rmt.h (_remdev): Look for / anywhere in Path.
3805
3806         * src/misc.c (contains_dot_dot): Skip filesystem prefix.
3807         Don't assume '/' is the only separator.
3808         (safer_rmdir): Don't assume '/' is the only separator.
3809
3810         * src/compare.c (diff_archive): Don't assume '/' is the only separator.
3811
3812         * lib/dirname.h (dirlen): New decl.
3813
3814         * src/incremen.c (get_directory_contents):
3815         Remove path_size arg; all callers changed.
3816         Don't assume '/' is the only directory separator.
3817         (gnu_restore): Work even if file name length doesn't fit in int.
3818
3819         * lib/addext.c (ISSLASH): New macro.
3820         (addext): Trim any redundant trailing slashes.
3821
3822         * src/names.c (name_next):
3823         Don't assume '/' is the only directory separator.
3824         (namelist_match): Likewise.
3825         (add_hierarchy_to_namelist): Remove dirsize arg.
3826         Do not assume '/' is the only directory separator.
3827         (new_name): Likewise.
3828
3829         * lib/Makefile.am (noinst_HEADERS): Add dirname.h, full-write.h.
3830         (libtar_a_SOURCES): Add dirname.c.
3831
3832         * src/create.c (relativize):
3833         New function, with much of old start_header's guts.
3834         Handle filesystem prefixes.
3835         (start_header): Use this new function.
3836         (init_sparsearray): Don't bother to zero out the new array;
3837         it's not needed.
3838         (deal_with_sparse): Fix array allocation bug.
3839         (create_archive): Don't assume '/' is the only separator.
3840         (dump_file): Likewise.
3841         Don't worry about leading / in symlink targets.
3842
3843         * lib/savedir.c (savedir):
3844         Remove size arg; it wasn't portable.  All callers changed.
3845
3846         * lib/utime.c (utime_null): Adjust to new full_write convention.
3847
3848         * configure.in (YACC): Avoid portability problem with Ultrix sh.
3849
3850         * lib/backupfile.c: Include <dirname.h>.
3851         (ISSLASH): New macro.
3852         (find_backup_file_name): Use dirlen to calculate directory lengths.
3853         (max_backup_version): Strip redundant trailing slashes.
3854
3855         * src/common.h: Include <full-write.h>.
3856         (get_directory_contents): No longer has size arg.
3857         (gnu_restore): Arg is size_t, not int.
3858
3859         * src/system.h: Include <time.h>.
3860         (time): Declare if not defined.
3861
3862         * lib/full-write.c: Include full-write.h, not safe-read.h.
3863         full_write returns size_t, with short writes meaning failure.
3864         All callers changed.
3865
3866         * src/rtapelib.c: Include full-write.h.
3867
3868         * src/rmt.c: Include full-write.h.
3869         (main): Update copyright.
3870
3871         * doc/getdate.texi: Mention that only English is supported.
3872         Show how to use "date" so that the output is acceptable to getdate.
3873         Mention Z as an abbreviation for UTC.
3874
3875         * lib/full-write.h: New file.
3876
3877         * src/list.c: system.h now does time.h stuff.
3878
3879         * lib/dirname.c:
3880         Use HAVE_STDLIB_H, not STDC_HEADERS, to decide whether to include
3881         stdlib.h.
3882         Do not include string.h, strings.h, or assert.h; no longer needed.
3883         (strrchr, memrchr, malloc): Remove decls; no longer needed.
3884         Include <xalloc.h>.
3885         (base_name): New decl.
3886         (BACKSLASH_IS_PATH_SEPARATOR): Remove.
3887         (dir_name_r): Remove.
3888         (dirlen): New function.
3889         (dir_name): Use dirlen instead of dir_name_r.
3890         (<string.h>, <strings.h>): Include only if test program.
3891         (main): Use "return 0", not "exit (0)".
3892
3893 2000-12-08  Paul Eggert  <eggert@twinsun.com>
3894
3895         * lib/dirname.h: New file.
3896
3897 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
3898
3899         * lib/fnmatch.c: Do not comment out all the code if we are using
3900         the GNU C library, because in some cases we are replacing buggy
3901         code in the GNU C library itself.
3902
3903 2000-10-30  Paul Eggert  <eggert@twinsun.com>
3904
3905         * lib/fnmatch.c (FOLD): Do not assume that characters are unsigned.
3906
3907 2000-10-29  Paul Eggert  <eggert@twinsun.com>
3908
3909         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.18.
3910
3911         * src/tar.c: Include <fnmatch.h>, for FNM_LEADING_DIR.
3912
3913 2000-10-28  Paul Eggert  <eggert@twinsun.com>
3914
3915         * doc/tar.texi: --no-recursion now applies to extraction, too.
3916         * src/create.c (dump_file): no_recurse_option -> ! recursion_option
3917         * src/names.c (namelist_match, excluded_name):
3918         Do not match subfiles of a directory
3919         if --no-recursion is specified.
3920         * src/tar.c (NO_RECURSE_OPTION): Remove.
3921         (long_options): Have getopt set the --no-recursion flag.
3922         (decode_options): Initialize recursion_option to FNM_LEADING_DIR.
3923         Remove case for NO_RECURSE_OPTION.
3924         * src/common.h (recursion_option):
3925         Renamed from no_recurse_option, with sense
3926         negated, and with FNM_LEADING_DIR being the nonzero value.
3927
3928         * names.c (namelist_match): New function.
3929         (name_match, name_scan): Use it to eliminate duplicate code.
3930         (names_notfound): Remove special case for Amiga.
3931
3932 2000-10-27  Paul Eggert  <eggert@twinsun.com>
3933
3934         * src/misc.c (read_error_details, read_warn_details,
3935         read_fatal_details): Don't assume size_t is unsigned long.
3936
3937         * src/buffer.c (flush_read): If read_full_records_option, try to
3938         fill the input buffer, as --delete -f - needs this.
3939
3940 2000-10-24  Paul Eggert  <eggert@twinsun.com>
3941
3942         * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Port to autoconf 2.13.
3943
3944         * src/buffer.c (check_label_pattern):
3945         Make sure header name is a string before
3946         passing it to fnmatch.
3947         (init_volume_number): Check for global_volno overflow.
3948         (new_volume): Check for global_volno overflow.
3949
3950         * src/tar.c (decode_options):
3951         Check that volume label is not too long to overflow
3952         name in tar header block.
3953
3954         * Makefile.am (EXTRA_DIST): Remove rebox.el.
3955
3956         * configure.in (HAVE_DECL_STRERROR_R): Remove our handwritten code.
3957         (AC_FUNC_STRERROR_R): Use this instead.
3958
3959 2000-10-23  Paul Eggert  <eggert@twinsun.com>
3960
3961         * src/extract.c: Include <time.h>, since we invoke "time".
3962
3963         * lib/prepargs.c (prepend_default_options):
3964         Don't use NULL, for portability.
3965
3966         * m4/fnmatch.m4: Add "working" to message.
3967
3968         * src/names.c: (_GNU_SOURCE): Remove; autoconf now does this.
3969         Include <hash.h>.
3970         (getpwuid, getgrgid): Declare only if system headers don't.
3971         (gid_to_gname): Don't invoke setgrent.
3972         (namelist): Now static, not global.
3973         (nametail): New var.  All uses of namelast changed to use
3974         nametail, with one extra level of indirection.
3975         (name_gather): Use memcpy instead of strncpy + assignment of NUL.
3976         (name_match): Set nametail too, when setting namelist to null.
3977         (add_hierarchy_to_namelist): Change type of dir arg from char * to
3978         struct name *, so that we don't have to look up the name again
3979         here.  Get change_dir from dir rather than as a separate arg.  Add
3980         dirsize arg, and pass it along to get_directory_contents.  Remove
3981         unnecessary check of directory type.
3982         (new_name): Do not append a slash if PATH already ends in one.
3983         (avoided_names, struct avoided_name): Remove.
3984         (avoided_name_table): New var, replacing avoided_names.
3985         (hash_avoided_name, compare_avoided_names): New function.
3986         (add_avoided_name, is_avoided_name): Use hash table rather than
3987         linked list.
3988
3989         * src/buffer.c (_GNU_SOURCE): Remove; autoconf now does this.
3990         (child_open_for_compress, child_open_for_uncompress,
3991         close_archive): Propagate any failure of the compression process
3992         back to "tar".
3993         (open_archive, flush_write, flush_read, close_archive): Do not
3994         allocate an array of size PATH_MAX, as PATH_MAX might be (size_t)
3995         -1.  Instead, allocate an array with the size that's needed.
3996         (open_archive): Don't bother checking S_ISCHR of /dev/null.
3997         (backspace_output): Don't try to backspace past start of archive.
3998         (close_archive): Remove special case for DELETE_SUBCOMMAND.
3999
4000         * acconfig.h (_GNU_SOURCE, DEFAULT_ARCHIVE, DEFAULT_BLOCKING,
4001         DENSITY_LETTER, DEVICE_PREFIX, EMUL_OPEN3, HAVE_GETGRGID,
4002         HAVE_GETPWUID, HAVE_MKNOD, HAVE_RTAPELIB, HAVE_ST_FSTYPE_STRING,
4003         HAVE_UNION_WAIT, HAVE_UTIME_H, HAVE_VALLOC, MTIO_CHECK_FIELD, PACKAGE,
4004         PROTOTYPES, REMOTE_SHELL, STD_INC_PATH, VERSION, WITH_CATALOGS,
4005         WITH_DMALLOC, WITH_REGEX):
4006         Remove; now generated automatically.
4007
4008         * configure.in (_GNU_SOURCE): Define to empty, not 1, for
4009         compatibility for glibc fragments.
4010         (_GNU_SOURCE, HAVE_UTIME_H, MTIO_CHECK_FIELD,
4011         HAVE_ST_FSTYPE_STRING, HAVE_MKNOD, REMOTE_SHELL, DENSITY_LETTER,
4012         DEVICE_PREFIX, DEFAULT_ARCHIVE, DEFAULT_BLOCKING): Add comment so
4013         that we needn't put an entry into acconfig.h.
4014         (ALL_LINGUAS): Add da.
4015         (AC_C_BACKSLASH_A): Remove; jm_PREREQ_QUOTEARG now does this.
4016         (AC_CHECK_HEADERS): Add stdbool.h (for hash.h users), wctype.h
4017         (for strtol.c).
4018         (AC_MBSTATE_T): Add.
4019         (RMT): Append $(EXEEXT).
4020         (HAVE_GETGRGID, HAVE_GETPWUID, pe_AC_TYPE_SIGNED_CHAR): Remove.
4021         (HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
4022         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
4023         HAVE_DECL_STRTOULL, HAVE_DECL_STRERROR_R): New macros.
4024         (jm_PREREQ_ADDEXT, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG): Add.
4025         (AC_REPLACE_FUNCS): Remove execlp; no longer needed.
4026         (AC_CHECK_FUNCS): Add clock_gettime; AC_SEARCH_LIBS wasn't enough.
4027         Remove mbrtowc; jm_PREREQ_QUOTEARG now does this.
4028         (EMUL_OPEN3): Remove; no longer needed.
4029         (DENSITY_LETTER, DEVICE_PREFIX): Simplify m4 quoting.
4030
4031         * m4/fnmatch.m4 (AC_FUNC_FNMATCH): Detect d*/*1 vs d/s/1 bug.
4032
4033         * src/common.h: Do not include basename.h.
4034         * src/rtapelib.c (base_name): Do not include basename.h;
4035         declare base_name instead.
4036
4037         * lib/basename.h, lib/execlp.c, lib/getpagesize.h, lib/mkdir.c:
4038         Remove these files.
4039         * lib/getstr.c, lib/getstr.h, lib/hash.h, lib/hash.h, lib/prepargs.c,
4040         lib/prepargs.h, lib/savedir.c, lib/savedir.h: New files.
4041         * lib/Makefile.am (EXTRA_DIST, noinst_HEADERS, libtar_a_SOURCES):
4042         Adjust to the above changes.
4043
4044         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove ../src/ansi2knr.
4045
4046         * src/open3.c: Remove.
4047
4048         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
4049         (tar_SOURCES): Remove open3.c.
4050         (INCLUDES): Remove -I.., as automake does that.
4051         (OMIT_DEPENDENCIES): ../lib/fnmatch.h -> fnmatch.h.  Add localedir.h.
4052
4053         The following changes are to put LOCALEDIR into localedir.h instead
4054         of passing it on the command line.
4055         (DEFS): Remove.
4056         (DISTCLEANFILES): New macro.
4057         (localedir.h): New rule.
4058         (rmt.o tar.o): Now depend on localedir.h.
4059
4060         * tests/delete02.sh, tests/extrac04.sh: New files.
4061
4062         * tests/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
4063         (TESTS): Add extrac04.sh, and restore delete02.sh.
4064         (DEFS): Remove; LOCALEDIR is now done via localedir.h.
4065         (INCLUDES): Remove -I.. as automake does this now.
4066
4067         * src/rtapelib.c (rexec): Don't declare unless using it.
4068         (do_command): Simplify signal-handling code slightly.
4069
4070         * src/delete.c (blocks_needed): Remove.  All uses changed to use
4071         blocking_factor - new_blocks.
4072         (acting_as_filter): New var.
4073         (write_record, delete_archive_members): Use acting_as_filter
4074         rather than archive == STDIN_FILENO to detect whether we're acting
4075         as a filter, as open can return STDIN_FILENO in some cases.
4076         (delete_archive_members): Ignore zero blocks if
4077         ignore_zeros_option is nonzero.  Fix bug that messed up last
4078         output block: write_eot can't be used here, as it gets confused
4079         when the input is at end of file.
4080
4081         * src/compare.c (diff_archive): Do not impose an arbitrary limit on
4082         symbolic link contents length.  Pass directory size to
4083         get_directory_contents.
4084
4085         * m4/decl.m4, m4/error.m4, m4/mbstate_t.m4, m4/prereq.m4,
4086         m4/strerror_r.m4: New files.
4087         * m4/signedchar.m4: Remove this file.
4088         * Makefile.am (ACINCLUDE_INPUTS): Adjust to above changes.
4089         * m4/Makefile.am (EXTRA_DIST): Likewise.
4090
4091         * Makefile.am (DISTCLEANFILES): Add intl/libintl.h.
4092
4093         * po/da.po: New translation file.
4094
4095         * src/mangle.c (extract_mangle):
4096         Fix diagnostic with wrong number of %s'es.
4097
4098         * lib/fnmatch.c (fnmatch):
4099         Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
4100         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
4101
4102         * lib/full-write.c (full_write): Some buggy drivers return 0 when you
4103         fall off a device's end.  Detect this.
4104
4105         * src/system.h (IN_CTYPE_DOMAIN): Renamed from CTYPE_DOMAIN.  All
4106         uses changed.
4107         (open): Remove macro; we no longer support EMUL_OPEN3.  Do not
4108         include <pathmax.h> and directory include files like <dirent.h>;
4109         no longer used.  Include <savedir.h> instead.
4110         (closedir, signed_char): remove macro; no longer used.
4111         (bool, false, true): Include <stdbool.h> if you have the include
4112         file, otherwise define.
4113
4114         * src/misc.c:
4115         (is_dot_or_dotdot, closedir_error, closedir_warn, opendir_error,
4116         opendir_warn, readdir_error): Remove; no longer needed.
4117         (safer_rmdir): Strip leading ./ (or .// or ./// or ././ or etc.)
4118         before deciding whether we're trying to remove ".".
4119         (remove_any_file): Try unlink first if we are not root.  Use
4120         savedir when recursively removing directories, to avoid exhausting
4121         file descriptors.
4122         (savedir_error, savedir_warn, symlink_error): New functions.
4123
4124         * src/list.c: (read_and): Do not invoke
4125         apply_nonancestor_delayed_set_stat; DO_SOMETHING is now
4126         responsible for that.  Do not invoke apply_delayed_set_stat; our
4127         caller is now responsible for that.
4128         (read_header): Use signed char instead of signed_char.  Prevent
4129         later references to current_header from mistakenly treating it as
4130         an old GNU header.
4131         (from_header): Quote invalid base-64 strings in diagnostics.
4132         (time_from_header): Do not warn about future timestamps in
4133         archive; check_time now does that.
4134         (print_header): Quote unknown file types.
4135         (skip_member): New function, replacing skip_extended_headers and
4136         now skipping the whole member instead of just the extended
4137         headers.  All callers changed.  This makes the code handle
4138         extended headers uniformly, and fixes some bugs.
4139
4140         * src/update.c (update_archive): Use skip_member.
4141
4142         * src/extract.c (we_are_root): Now global.
4143         (struct delayed_symlink): New type.
4144         (delayed_symlink_head): New var.
4145         (extr_init, fatal_exit): Invoke extract_finish on fatal errors,
4146         not apply_delayed_set_stat.
4147         (set_mode, set_stat): Pointer args are now const pointers.
4148         (check_time): New function.
4149         (set_stat): Warn if setting a file's timestamp to be the future.
4150         (make_directories): Do not save and restore errno.
4151         (maybe_recoverable): Set errno to ENOENT if we cannot make missing
4152         intermediate directories.
4153         (extract_archive): Invoke apply_nonancestor_delayed_set_stat here,
4154         not in caller.  Extract potentially dangerous symbolic links more
4155         carefully, deferring their creation until the end, and using a
4156         regular file placeholder in the meantime.  Do not remove trailing
4157         / and /. from file names.  Do not bother checking for ".." when
4158         checking whether a directory loops back on itself, as loopbacks
4159         can occur with symlinks too.  Also, in that case, do not bother
4160         saving and restoring errno; just set it to EEXIST.
4161         (apply_nonancestor_delayed_set_stat): A prefix is a potential
4162         ancestor if it ends in slash too (as well as ending in a char just
4163         before slash).
4164         (apply_delayed_set_stat): Remove.
4165         (apply_delayed_symlinks, extract_finish): New functions.
4166
4167         * doc/fdl.texi: New file.
4168         * doc/Makefile.am (EXTRA_DIST): Add fdl.texi.
4169         ($(srcdir)/tar.info): Add fdl.texi.  Invoke makeinfo with --no-split.
4170         * doc/tar.texi: Add Free Documentation License.  New section
4171         "Overwrite Old Files", and revamp that section to make it easier to
4172         follow.  "tar" -> "GNU tar" where appropriate.  Migrate getdate
4173         documentation into getdate.texi.  Fix several minor typos.  Describe
4174         TAR_OPTIONS.  Describe incompatibility between incremental backups and
4175         --atime-preserve.  Describe incompatibility between --verify and other
4176         options.  Mention that tar normally removes symbolic links rather than
4177         following them, when extracting a file of the same name.
4178
4179         * THANKS: Add gpoul.  Change skip's address.
4180
4181         * po/POTFILES.in: Add lib/human.c.
4182
4183         * src/common.h (namelist, namelast): Remove decls.
4184         (we_are_root, extract_finish, skip_member, savedir_error,
4185         savedir_warn, symlink_error, gnu_list_name): New decls.
4186         (apply_delayed_set_stat, apply_nonancestor_delayed_set_stat,
4187         skip_extended_headers, is_dot_or_dotdot, closedir_error,
4188         closedir_warn, opendir_error, opendir_warn, readdir_error,
4189         readdir_warn): Remove decls.
4190         (get_directory_contents): New off_t arg.
4191         (addname): Now returns struct name *.
4192
4193         * src/tar.h, tests/genfile.c: Fix comments.
4194
4195         * src/create.c: Include hash.h.
4196         (gnu_list_name): Remove decl.
4197         (struct link): Remove "next" member.
4198         (linklist): Remove.
4199         (start_header): Say "leading `FOO'" rather than "`FOO' prefix" for
4200         consistency with other diagnostics.
4201         (deal_with_sparse): Check for I/O error when closing the file.
4202         (create_archive): Do not allocate an array of size PATH_MAX, as
4203         PATH_MAX might be (size_t) -1.  Instead, allocate an array with
4204         the size that's needed.
4205         (hash_link, compare_links): New functions.
4206         (dump_file): Do not exhaust open file descriptors when descending
4207         deeply into a directory, by using savedir rather than
4208         opendir/readdir.  Do not zero-fill the name buffer unnecessarily.
4209         Hash the set of links already created, instead of using a linked
4210         list.  Fix some bugs in outputting sparse files which caused the
4211         sparse tables to be incorrect.  When a file unexpectedly shrinks,
4212         output zeros rather than garbage.  Do not allocate an array of
4213         size PATH_MAX, as PATH_MAX might be (size_t) -1.  Instead,
4214         allocate an array with the size that's needed.
4215
4216         * src/incremen.c: Include hash.h.
4217         (struct directory): Remove "next", "dir_text".  Change "name" to
4218         be char[1] with struct hack, not const char *.  Add "found".
4219         (directory_list): Remove.  Replaced by directory_table.
4220         (directory_table): New var.
4221         (nfs_string): Renamed from nfs.
4222         (hash_directory, compare_directories): New functions.
4223         (note_directory): Now returns struct directory *.  First arg is
4224         now const pointer.  struct stat arg is now dev_t, ino_t, nfs.
4225         Remove text arg.  New "found" arg, basically corresponding to the
4226         old text arg not being null.  All callers changed.
4227         (note_directory, find_directory): Use hash table rather than
4228         linked list.
4229         (get_directory_contents): New arg "device".  Use savedir to do the
4230         hard work.  Save the nfs-ness of stat_data, since it might change
4231         under us.  Use note_directory instead of find_directory to save
4232         some work.  When adding an "A" record, do it with
4233         add_to_accumulator instead of cheating with strcat.
4234         (read_directory_file): Use "+" flag before device to indicate
4235         whether it was NFS.  Fix typo in checking for strtoul error.
4236         (write_directory_file_entry): New function.
4237         (write_directory_file): Use it, and use the hash routines to
4238         traverse the directory table.
4239         (gnu_restore): Use savedir rather than opendir/readdir.
4240
4241         * src/tar.c: Include localedir.h, prepargs.h.
4242         (long_options): Now static.
4243         (long_options, usage, decode_options): -j is now short for
4244         --bzip2, and -I is now an alias for -T.
4245         (decode_options, main): argv is not const pointer now.
4246         (decode_options): Invoke prepend_default_options to support
4247         TAR_OPTIONS.  In diagnostic, mention the string that was the
4248         invalid blocking factor, tape length, group, owner, or record
4249         size.  --delete is no longer incompatible with -f -, undoing
4250         2000-01-07 change.
4251         (main): Invoke extract_finish at end of extraction.
4252
4253         * src/rmt.c: Include localedir.h.
4254         (main): Update copyright date to 2000.
4255
4256         * doc/getdate.texi: New file, taken from fileutils 4.0.27, with the
4257         following changes: Use @sc where appropriate.  Document the ranges of
4258         supported times more precisely.  Add Eggert to getdate authors.
4259         Document old Latin 12m/12pm tradition.  Remove list of alphabetic time
4260         zone names, as it wasn't correct and people shouldn't be relying on it
4261         anyway.  Relative items also account for non-DST adjustments.  Fix
4262         some misspellings.
4263
4264         * lib/prepargs.c, lib/prepargs.h, tests/extrac04.sh: New file.
4265
4266         * tests/ignfail.sh: opendir -> savedir in diagnostics.
4267
4268         * tests/preset.in: Set LANGUAGE to the empty string, for some
4269         brain damaged host.
4270
4271 2000-10-20  Paul Eggert  <eggert@twinsun.com>
4272
4273         * m4/fnmatch.m4: Mention the GNU C library.
4274
4275 2000-10-19  Paul Eggert  <eggert@twinsun.com>
4276
4277         * m4/fnmatch.m4: Add a couple more test cases to catch bugs in
4278         glibc 2.1.95.
4279
4280 2000-10-17  Paul Eggert  <eggert@twinsun.com>
4281
4282         * lib/human.c (<limits.h>): Do not include; human.h does it if needed.
4283         (CHAR_BIT): Remove.
4284
4285         * lib/human.h (<limits.h>): Include if HAVE_LIMITS_H.
4286         (CHAR_BIT): Define if not defined.
4287
4288 2000-09-09  Paul Eggert  <eggert@twinsun.com>
4289
4290         * lib/quotearg.c: From fileutils: rename ISASCII to IN_CTYPE_DOMAIN.
4291
4292 2000-08-07  Paul Eggert  <eggert@twinsun.com>
4293
4294         * lib/xmalloc.c: Memory exhausted -> memory exhausted
4295
4296         * lib/xalloc.h (xalloc_msg_memory_exhausted):
4297         change to array from char *.
4298
4299 2000-08-06  Paul Eggert  <eggert@twinsun.com>
4300
4301         * m4/mbstate_t.m4: Define mbstate_t to be int, not char, for
4302         compatibility with glibc 2.1.3 strftime.c.
4303
4304 2000-07-31  Paul Eggert  <eggert@twinsun.com>
4305
4306         * lib/quotearg.c (quotearg_n_options):
4307         Don't make the initial slot vector a constant,
4308         since it might get modified.
4309
4310         * lib/quotearg.c: Add support for more than one preallocated slot.
4311
4312 2000-07-30  Paul Eggert  <eggert@twinsun.com>
4313
4314         * lib/quotearg.c (quotearg_n_options):
4315         Preallocate a slot 0 buffer, so that the caller
4316         can always quote one small component of a "memory exhausted" message
4317         in slot 0.
4318
4319 2000-07-23  Paul Eggert  <eggert@twinsun.com>
4320
4321         * lib/quotearg.c:
4322         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX), so that
4323         mbstate_t is always defined.
4324
4325         Do not inspect MB_LEN_MAX, since it's incorrectly defined to be 1 in
4326         some GCC installations, and this configuration error is likely to be
4327         common.
4328
4329 2000-07-22  Paul Eggert  <eggert@twinsun.com>
4330
4331         * lib/quotearg.c:
4332         When the system forces us to redefine mbstate_t, shadow its mbsinit
4333         function.  From Bruno Haible.
4334
4335 2000-07-14  Paul Eggert  <eggert@twinsun.com>
4336
4337         * lib/xmalloc.c: Simplify exhausted message.
4338
4339         * lib/quotearg.h: Update copyright date; from Jim Meyering.
4340
4341 2000-07-13  Paul Eggert  <eggert@twinsun.com>
4342
4343         * lib/quotearg.h (enum quoting style):
4344         New constant clocale_quoting_style.
4345
4346         * lib/quotearg.c:
4347         (quoting_style_args, quoting_style_vals, quotearg_buffer_restyled):
4348         Add support for clocale_quoting_style, undoing previous change to
4349         locale_quoting_style.
4350
4351 2000-07-10  Paul Eggert  <eggert@twinsun.com>
4352
4353         * lib/quotearg.c:
4354         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX,
4355         since otherwise we don't need it.
4356         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
4357         since we don't do multibytes in that case.
4358         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
4359         invoke multibyte primitives.
4360
4361         * m4/mbstate_t.m4 (AC_MBSTATE_T):
4362         Renamed from AC_MBSTATE_T_OBJECT.  All uses changed.
4363         Change from a two-part test, which defines both HAVE_MBSTATE_T_OBJECT
4364         and mbstate_t, to a single-part test that simply defines mbstate_t.
4365
4366         * lib/quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
4367         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
4368         to decide whether to define the BeOS workaround macro;
4369         this adjusts to the change to AC_MBSTATE_T.
4370
4371         * m4/strerror_r.m4: New file.
4372
4373 2000-07-05  Paul Eggert  <eggert@twinsun.com>
4374
4375         * lib/quotearg.c: Use double-quote to quote.
4376
4377         * lib/quotearg.c (N_): New macro.
4378         (gettext_default): New function.
4379         (quotearg_buffer_restyled): Use gettext_default ("{LEFT QUOTATION MARK}",
4380         "\"") for left quote, and gettext_default ("{RIGHT QUOTATION MARK}", "\"")
4381         for right quote.
4382
4383         * lib/quotearg.c (struct quoting_options):
4384         Simplify quote_these_too dimension.
4385         From Bruno Haible  <haible@clisp.cons.org>.
4386
4387         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT):
4388         Test for mbstate_t only if the test
4389         for an object-type mbstate_t fails.
4390
4391         * lib/quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
4392
4393 2000-07-03  Paul Eggert  <eggert@twinsun.com>
4394
4395         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT): Port to autoconf 2.13.
4396         Add AC_CHECK_HEADERS(stdlib.h), since we use HAVE_STDLIB_H.
4397
4398         * lib/quotearg.c (mbrtowc):
4399         Assign to *pwc, and return 1 only if result is nonzero.
4400         (iswprint): Define to ISPRINT if we are substituting our own mbrtowc.
4401
4402 2000-07-02  Paul Eggert  <eggert@twinsun.com>
4403
4404         * lib/quotearg.c (mbstate_t):
4405         Do not define; it should be defined with AC_CHECK_TYPE.
4406
4407 2000-06-26  Paul Eggert  <eggert@twinsun.com>
4408
4409         * m4/mbstate_t.m4: Include stdio.h before wchar.h, to work around
4410         a bug in glibc 2.1.3.
4411
4412         * lib/xmalloc.c: Fix inaccurate comment for xrealloc.
4413
4414 2000-06-19  Paul Eggert  <eggert@twinsun.com>
4415
4416         * lib/quotearg.c (ISASCII): Add #undef and move definition to follow
4417         inclusion of wctype.h to work around solaris2.6 namespace pollution.
4418         (ISPRINT): Likewise.
4419         Reported by Tom Tromey.
4420
4421 2000-06-15  Paul Eggert  <eggert@twinsun.com>
4422
4423         * lib/human.c (adjust_value): New function.
4424         (human_readable_inexact): Apply rounding style even when printing
4425         approximate values.
4426
4427         * lib/human.c: Avoid shadowing warnings.
4428         From Jim Meyering.
4429
4430 2000-06-14  Paul Eggert  <eggert@twinsun.com>
4431
4432         * lib/human.c (human_readable_inexact): Allow an input block size
4433         that is not a multiple of the output block size, and vice versa.
4434
4435         * lib/getdate.y (get_date): Apply relative times after time zone
4436         indicator, not before.
4437
4438 2000-05-31  Paul Eggert  <eggert@twinsun.com>
4439
4440         * m4/largefile.m4: Rewrite so that we don't need to run getconf,
4441         and thus don't need AC_CANONICAL_HOST.
4442
4443         (AC_SYS_LARGEFILE_FLAGS, AC_SYS_LARGEFILE_SPACE_APPEND): Remove.
4444         (AC_SYS_LARGEFILE_TEST_INCLUDES): New macro.
4445         (AC_SYS_LARGEFILE_MACRO_VALUE): Change arguments from
4446         CODE-TO-SET-DEFAULT to VALUE, INCLUDES, FUNCTION-BODY.  All uses
4447         changed.  Instead of inspecting the output of getconf, try to
4448         compile the test program without and with the macro definition.
4449         (AC_SYS_LARGEFILE): Do not require AC_CANONICAL_HOST or check for
4450         getconf.  Instead, check for the needed flags by compiling test
4451         programs.
4452
4453         * configure.in (AC_CANONICAL_HOST): Remove; the largefile stuff no
4454         longer needs it.
4455         * config.guess, config.sub: Remove these files, for similar reasons.
4456
4457 2000-05-03  Paul Eggert  <eggert@twinsun.com>
4458
4459         * m4/largefile.m4 (AC_SYS_LARGEFILE): Define _XOPEN_SOURCE to be
4460         500, instead of _GNU_SOURCE to be 1, to work around glibc 2.1.3
4461         bug.  This avoids a clash when files like regex.c that define
4462         _GNU_SOURCE.
4463
4464 2000-05-02  Paul Eggert  <eggert@twinsun.com>
4465
4466         * m4/largefile.m4 (AC_SYS_LARGEFILE):
4467         Define _GNU_SOURCE if this is needed to make
4468         ftello visible (e.g. glibc 2.1.3).  Use compile-time test, rather than
4469         inspecting host and OS, to decide whether to define _LARGEFILE_SOURCE.
4470
4471         * lib/quotearg.c (mbrtowc, mbstat_t):
4472         Add definitions if !HAVE_MBSTATE_T_OBJECT.
4473         (<wctype.h>): Include if HAVE_WCTYPE_H.
4474         (iswprint): Define to 1 if we lack it
4475
4476 2000-04-18  Paul Eggert  <eggert@twinsun.com>
4477
4478         * m4/mbstate_t.m4: New file.
4479
4480 2000-04-17  Bruno Haible  <haible@clisp.cons.org>
4481
4482         * tests/ignfail.sh: Test for uid 0 along with user "root".
4483
4484 2000-04-05  Paul Eggert  <eggert@twinsun.com>
4485
4486         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS):
4487         Don't use -n32 on IRIX if the installer said
4488         otherwise.
4489
4490 2000-02-28  Paul Eggert  <eggert@twinsun.com>
4491
4492         * lib/quotearg.c (ALERT_CHAR): New macro.
4493         (quotearg_buffer_restyled): Use it.
4494
4495 2000-02-23  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
4496
4497         * src/list.c (tartime): Fix off-by-one error when copying year if
4498         OLD_CTIME.
4499
4500 2000-02-18  Paul Eggert  <eggert@twinsun.com>
4501
4502         * lib/getdate.y: Handle two-digit years with leading zeros correctly.
4503         (textint): New typedef.
4504         (parser_control): Changed from struct parser_control to typedef
4505         (for consistency).  Member year changed from int to textint.  All
4506         uses changed.
4507         (YYSTYPE): Removed; replaced by %union with int and textint
4508         members.
4509         (tID): Removed; not used.
4510         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE,
4511         tMERIDIAN, tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER,
4512         tUNUMBER, tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
4513         (tSNUMBER, tUNUMBER): Now of type <textintval>.
4514         (date, number, to_year): Use width of number in digits, not its
4515         value, to determine whether it's a 2-digit year, or a 2-digit
4516         time.
4517         (yylex): Store number of digits of numeric tokens.  Return '?' for
4518         unknown identifiers, rather than (unused) tID.
4519
4520 2000-01-16  Paul Eggert  <eggert@twinsun.com>
4521
4522         * lib/quotearg.c (quotearg_buffer_restyled):
4523         Do not quote alert, backslash, formfeed,
4524         and vertical tab unnecessarily in shell quoting style.
4525
4526 2000-01-15  Paul Eggert  <eggert@twinsun.com>
4527
4528         * m4/c-bs-a.m4:
4529         Change quoting to be compatible with future autoconf versions.
4530
4531 2000-01-11  Paul Eggert  <eggert@twinsun.com>
4532
4533         * lib/exclude.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove unused macros.
4534
4535 2000-01-07  Paul Eggert  <eggert@twinsun.com>
4536
4537         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.17.
4538
4539         Fix bug with fnmatch.h dependency, as follows:
4540         * src/Makefile.am (OMIT_DEPENDENCIES): New macro.
4541         * lib/Makefile.am (OMIT_DEPENDENCIES): New macro.
4542
4543         * src/common.h (apply_nonancestor_delayed_set_stat):
4544         Renamed from apply_delayed_set_stat.
4545         (apply_delayed_set_stat, decode_mode, chmod_error_details,
4546         chown_error_details, close_warn, closedir_warn, mkdir_error,
4547         read_error_details, read_fatal_details, read_warn_details,
4548         seek_error_details, seek_warn_details, utime_error,
4549         write_error_details, write_fatal_details): New decls.
4550
4551         Make diagnostic messages more regular.
4552         * src/create.c (dump_file): Quote file names with colons if possible.
4553         * src/compare.c (diff_archive): Likewise.
4554         * src/extract.c (repair_delayed_set_stat, extract_archive): Likewise.
4555         * src/incremen.c (get_directory_contents, gnu_restore): Likewise.
4556         * src/mangle.c (extract_mangle): Likewise.
4557         * src/misc.c (call_arg_error, call_arg_fatal, call_arg_warn):
4558         Likewise.
4559         * src/buffer.c (archive_write_error, flush_archive, close_archive,
4560         new_volume, xclose):
4561         Use error message functions to report errors consistently.
4562         * src/compare.c (diff_sparse_files, diff_archive): Likewise.
4563         * src/create.c (finish_sparse_file, dump_file): Likewise.
4564         * src/extract.c (set_mode, set_stat, extract_sparse_file,
4565         extract_archive): Likewise.
4566         * src/list.c (list_archive): Likewise.
4567         * src/update.c (append_file): Likewise.
4568         * src/compare.c (diff_init, diff_sparse_files):
4569         Use xalloc_die to report memory exhaustion.
4570         * src/incremen.c (gnu_restore): Likewise.
4571         * src/list.c (read_header): Likewise.
4572         * src/mangle.c (extract_mangle): Likewise.
4573         * src/misc.c (maybe_backup_file): Likewise.
4574         * src/tar.c (decode_options): Likewise.
4575         * src/compare.c (read_and_process, fill_in_sparse_array,
4576         diff_sparse_files):
4577         Use consistent terminology for unexpected-EOF message.
4578         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
4579         * src/list.c (list_archive, read_header, skip_file,
4580         skip_extended_headers): Likewise.
4581         * src/buffer.c (archive_write_error): Add noreturn attribute to decl.
4582         (xdup2): Regularize messages with rest of tar.
4583
4584         * src/buffer.c (flush_read): Don't read past EOF.
4585
4586         * src/extract.c (extr_init):
4587         If we run out of memory, invoke apply_delayed_set_stat.
4588         (prepare_to_extract): Don't complain if we can't remove ".".
4589         (apply_delayed_set_stat): New function.
4590         (apply_nonancestor_delayed_set_stat):
4591         Renamed from apply_delayed_set_stat.  All uses changed.
4592         Don't remove head if it doesn't apply.
4593
4594         * src/create.c (find_new_file_size):
4595         Return size instead of storing through pointer.
4596         All callers changed.
4597         (deal_with_sparse): Don't keep reading after read errors.
4598         (finish_sparse_file): Just abort if there is an internal error.
4599         (dump_file): Fix typo: stat_warn and stat_error were interchanged.
4600         Don't restore access times on directories during incremental dumps
4601         until after dealing with the directory.
4602         If ignoring failed reads, count closedir, read, and unknown
4603         file errors as warnings, not errors.
4604         Fix buffer overrun problem when dumping sparse files.
4605
4606         * src/list.c (read_and):
4607         Invoke apply_nonancestor_delayed_set_stat on file names
4608         after handling them.
4609         (decode_mode): Remove; moved to misc.c.
4610
4611         * src/misc.c (safer_rmdir): New function.
4612         (remove_any_file): Use it to avoid problems with rmdir(".").
4613         (maybe_backup_file): Regularize diagnostics.
4614         (undo_backup_file): Likewise.
4615         (decode_mode): Moved here from list.c.
4616         (chmod_error_details, chown_error_details, close_fatal,
4617         close_warn, closedir_warn, mkdir_error, read_error_details,
4618         read_warn_details, read_fatal_details, seek_error_details,
4619         seek_warn_details, utime_error, write_error_details,
4620         write_fatal_details): New functions.
4621
4622         * src/delete.c (save_record): Remove static variable (now local).
4623         (move_archive): Don't position before start of archive.
4624         (write_record): Abort if count is zero at inopportune time.
4625         Plug memory leak.
4626
4627         * src/tar.c (decode_options): --delete and -f - are now
4628         incompatible, since we didn't have time to fix their bugs.
4629
4630         * tests/Makefile.am (TESTS): Remove delete02.sh.
4631         * tests/ignfail.sh: Adjust to new quoting scheme again.
4632
4633 2000-01-06  Paul Eggert  <eggert@twinsun.com>
4634
4635         * lib/getdate.y: Sync tm_diff with the GNU C Library.
4636         (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN.  All uses changed.
4637         (tm_diff): Renamed from difftm.  All uses changed.
4638         Replace body with that taken from GNU C Library 2.1.3pre1.
4639         (get_date): Prefer tm_gmtoff to tm_diff if available.
4640
4641 1999-12-29  "Melissa O'Neill"  <oneill@cs.sfu.ca>
4642
4643         * tests/incremen.sh: Invoke stat on newly created file so that its
4644         ctime is updated on Nextstep.
4645
4646 1999-12-21  Machael Stone  <mstone@cs.loyola.edu>
4647
4648         * lib/getdate.y (get_date):
4649         Fix typo when checking for time_t overflow in time zone calculations.
4650
4651 1999-12-13  Paul Eggert  <eggert@twinsun.com>
4652
4653         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.16.
4654
4655         * README-alpha: New file.
4656         * README: New sections for gzip and bzip2, Solaris.
4657         Remove mention of BACKLOG.
4658
4659         * configure.in (AC_C_BACKSLASH_A): Add.
4660         (AC_CHECK_HEADERS): Add wchar.h.
4661         (AC_CHECK_FUNCS): Add mbrtowc.
4662         (AC_FUNC_CLOSEDIR_VOID): Add.
4663
4664         * tests/Makefile.am (TESTS): Add delete02.sh.
4665         (POSTPONED_TESTS): Remove.
4666         (EXTRA_DIST): Remove $(POSTPONED_TESTS).
4667
4668         * tests/preset.in:
4669         Set LC_ALL rather than LANGUAGE, LANG, and LC_MESSAGES.
4670
4671         * tests/ignfail.sh (err): Adjust to new quoting scheme.
4672
4673         * tests/delete02.sh: Fix typo: need to list archive2, not archive.
4674
4675         * tests/extrac03.sh: Use -P option, so that .. doesn't get diagnosed.
4676
4677         * src/tar.c ("quotearg.h"): New include.
4678         (usage): Now has __attribute__ ((noreturn)).
4679         (confirm): Report errno if we can't open tty.
4680         (confirm, decode_options):
4681         Quote arbitrary strings in diagnostics.
4682         (OVERWRITE_OPTION): New constant.
4683         (long_options, usage, decode_options): New --overwrite option.
4684         (decode_options): --keep-old-files, --overwrite, and --unlink-first
4685         are now mutually exclusive.
4686         Don't assume that gettext preserves errno.
4687         (main): Set default quoting style to escape_quoting_style.
4688
4689         * src/update.c (<quotearg.h>): New include.
4690         (append_file):
4691         Don't assume that gettext preserves errno.
4692         Quote arbitrary strings in diagnostics.
4693         Check for close error.
4694
4695         * src/names.c (<quotearg.h>): New include.
4696         (name_init, name_next, name_close, names_notfound,
4697         collect_and_sort_names): Don't assume that gettext preserves
4698         errno.  Quote arbitrary strings in diagnostics.
4699         (excluded_name): Fix typo that caused empty patterns to be
4700         mishandled.
4701
4702         * src/misc.c (<quotearg.h>): New include.
4703         (quote_copy_string): Quote only newline and backslash; the output is no
4704         longer meant for humans, and is locale-independent.
4705         (contains_dot_dot): New function.
4706         (remove_any_file): Don't use lstat; just rmdir the file and then use
4707         unlink if the rmdir fails because the file isn't a directory.
4708         Check for readdir and closedir errors.
4709         (maybe_backup_file): Report "stat" for stat errors.
4710         (maybe_backup_file, chdir_do):
4711         Quote arbitrary strings in diagnostics.
4712         (maybe_backup_file, undo_last_backup):
4713         Don't assume that gettext preserves errno.
4714         (call_arg_error, call_arg_fatal, call_arg_warn,
4715         chdir_fatal, close_error, closedir_error, exec_fatal, mkfifo_error,
4716         mknod_error, open_error, open_fatal, open_warn, opendir_error,
4717         opendir_warn, read_error, read_fatal, readdir_error, readdir_warn,
4718         readlink_error, readlink_warn, seek_error, seek_warn, stat_error,
4719         stat_warn, truncate_error, truncate_warn, unlink_error, waitpid_error,
4720         write_error, write_fatal, xfork, xpipe, quote_n, quote): New functions.
4721
4722         * src/system.h (__attribute__): New macro.
4723         (O_NDELAY, O_NONBLOCK, O_APPEND): Remove.
4724         (S_ISDOOR): New macro.
4725         (closedir): New macro, if CLOSEDIR_VOID.
4726
4727         * src/rmt.c, src/rtapelib.c (decode_oflag):
4728         O_APPEND might not be defined.
4729
4730         * src/list.c: (read_and, list_archive):
4731         Quote arbitrary strings in diagnostics.
4732         (from_header): Use locale_quoting_style to quote diagnostics.
4733         (print_header, print_for_mkdir): Quote with quotearg, not quote_copy_string.
4734
4735         * src/rmt.h (REM_BIAS): Increase from 128 to (1 << 30).
4736
4737         * src/Makefile.am: Use ## for copyright comments.
4738
4739         * src/extract.c (<quotearg.h>): New include.
4740         (enum permstatus): New enum.
4741         (struct delayed_set_stat): file_name is now at end of buffer, to avoid
4742         two mallocs.  New members file_name_len, invert_permissions, permstatus.
4743         (extr_init): Remove hack that silently adjusted newdir_umask.
4744         (set_mode, set_stat): New args invert_permissions, permstatus, typeflag.
4745         Use these args to decide whether and how to set modes.
4746         (set_mode, set_stat, prepare_to_extract, extract_sparse_file, extract_archive):
4747         Don't assume that gettext preserves errno.
4748         (set_stat): Remove arg symlink_flag; subsumed by typeflag.
4749         (delay_set_stat, repair_delayed_set_stat): New functions.
4750         (make_directories): Avoid mkdir where last part of path is "..".
4751         Create a struct delayed_set_stat for each directory made.
4752         (prepare_to_extract): Renamed from unlink_destination, and
4753         return 0 immediately if to_stdout_option; all callers changed.
4754         (maybe_recoverable): New parameter interdir_made.
4755         Add support for --overwrite.
4756         (extract_sparse_file, extract_archive):
4757         Quote arbitrary strings in diagnostics.
4758         (extract_archive): By default, warn about ".." in member names, and skip them.
4759         Don't open files with O_NONBLOCK or O_APPEND.
4760         Open with O_TRUNC only if --overwrite; otherwise, use O_EXCL to avoid
4761         overwriting them.  Pass only rwxrwxrwx permissions to `open' and `mkdir',
4762         minus the current umask.  Keep track of intermediate directories made,
4763         to avoid looping when making x/../x when x doesn't exist; the
4764         earlier code solved this in a different way that didn't fit well
4765         into the new scheme.  Don't extract permissions onto existing
4766         directories unless --overwrite is given.  Do not add -wx------
4767         permissions to new directories permanently; just do it temporarily.
4768         Remove no-longer-needed hack with MSDOS and directory time stamps.
4769         (apply_delayed_set_stat): New argument specifies which directories to
4770         fix statuses of.  Do not wait until the end of extraction to fix
4771         statuses; instead, fix a directory's status once we exit that directory.
4772         This requires less memory and does the right thing in some cases
4773         where the old method didn't.
4774         (fatal_exit): New function.
4775
4776         * src/incremen.c (<quotearg.h>): New include.
4777         (get_directory_contents, gnu_restore):
4778         Check for readdir and closedir errors.
4779         (get_directory_contents, read_directory_file, gnu_restore):
4780         Quote arbitrary strings in diagnostics.
4781         (get_directory_contents, read_directory_file, write_directory_file):
4782         Don't assume that gettext preserves errno.
4783
4784         * src/create.c (<quotearg.h>): New include.
4785         (start_header): Use `member names' to refer to archive member names, not
4786         `archive names'.  Warn about `..' in member names.
4787         (finish_sparse_file, dump_file):
4788         Quote arbitrary strings in diagnostics.
4789         (finish_sparse_file, dump_file):
4790         Don't assume that gettext preserves errno.
4791         (dump_file): Don't use `access' to determine whether a directory is readable;
4792         this isn't reliable if tar is setuid.  Use `opendir' instead.
4793         Check for readdir and closedir failures.
4794         Don't dump sockets as if they were fifos; just warn and skip.
4795
4796         * src/delete.c (move_archive):
4797         Don't report fatal error merely because sizes don't fit
4798         into struct mtop values; fall back on lseek instead.
4799         Say `Cannot' uniformly, instead of `Could not' sometimes and `Cannot' others.
4800         Say `reposition' instead of `re-position'.
4801         (delete_archive_members):
4802         Set archive to STDOUT_FILENO before outputting trailing buffer.
4803
4804         * src/compare.c (<quotearg.h>): New include.
4805         (diff_init): Use `Cannot' uniformly, instead of `Could not' sometimes
4806         and `Cannot' others.
4807         (report_difference, diff_archive):
4808         Quote arbitrary strings in diagnostics.
4809         (process_rawdata, diff_sparse_files, get_stat_data, diff_archive, seek_warn):
4810         Don't assume that gettext preserves errno.
4811         (diff_archive): Don't open regular files with O_NONBLOCK.
4812         Preserve access times of files if --atime.
4813
4814         * src/common.h (FATAL_ERROR): Use new fatal_exit function to exit.
4815         (FATAL_ERROR, USAGE): Don't return 0.
4816         (enum old files): New enum.
4817         (old_files_option): New variable, replacing keep_old_files_option and
4818         unlink_first_option.
4819         (apply_delayed_set_stat): Now takes char const * param.
4820         (fatal_exit, contains_dot_dot, chdir_fatal, close_error,
4821         closedir_error, exec_fatal, mkfifo_error, mknod_error, open_error,
4822         open_fatal, open_warn, opendir_error, opendir_warn, read_error,
4823         read_fatal, readdir_error, readdir_warn, readlink_error,
4824         readlink_warn, seek_error, seek_warn, stat_error, stat_warn,
4825         truncate_error, truncate_warn, unlink_error, waitpid_error,
4826         write_error, write_fatal, xfork, xpipe, quote, quote_n): New decls.
4827
4828         * src/buffer.c:
4829         (xclose, xdup2, child_open_for_compress, child_open_for_uncompress,
4830         archive_write_error, archive_read_error, flush_archive, close_archive,
4831         init_volume_number, new_volume):
4832         Don't assume that gettext preserves errno.
4833
4834         (xdup2): Don't report errno if dup returns an unexpected nonnegative value.
4835         (open_archive): Reject multivolume verify attempts a bit earlier.
4836         Rename local variable `access', in case it's defined by system header.
4837
4838         (open_archive, backspace_output): Use `Cannot' uniformly, instead of
4839         `Could not' sometimes and `Cannot' others.
4840
4841         (open_archive, flush_read, flush_archive, close_archive, new_volume):
4842         Quote arbitrary strings in diagnostics.
4843
4844         (read_error): Set archive to STDOUT_FILENO temporarily when writing
4845         archive buffer.
4846
4847         (init_volume_number): Check for input and output errors in volno_file.
4848
4849         (new_volume): Use new fatal_exit function to exit, and new xfork
4850         function to fork.
4851
4852         * m4/Makefile.am (EXTRA_DIST): Add c-bs-a.m4.
4853
4854         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/c-bs-a.m4.
4855
4856         * doc/tar.texi: Add --overwrite.
4857         --absolute-names rejects ".." in names.
4858
4859         * lib/quotearg.c: Add support for multibyte characters.
4860         (ISGRAPH): Remove.
4861         (ISPRINT): New macro.
4862         (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
4863         (isprint, mbrtowc, mbsinit, mbstate_t): New macros,
4864         defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
4865         (quotearg_buffer_restyled): New function, with most of the old
4866         quotearg_buffer's contents.
4867         Major rewrite to support multibyte characters.
4868         (quotearg_buffer): Now just calls quotearg_buffer_restyled.
4869
4870         * m4/c-bs-a.m4: New file.
4871
4872         * lib/Makefile.am: Use ## for copyright notice.
4873
4874         * scripts/Makefile.am: Use ## on copyright notice.
4875
4876         * doc/Makefile.am:
4877         ($(srcdir)/tar.info, tar.dvi): We now use texinfo 4.0.
4878
4879 1999-12-05  Paul Eggert  <eggert@twinsun.com>
4880
4881         * doc/ChangeLog, lib/ChangeLog, scripts/ChangeLog,
4882         src/ChangeLog, tests/ChangeLog: Remove these files.
4883         * ChangeLog.1: New file, incorporating the above files, plus old
4884         ChangeLog entries.
4885         * Makefile.am (EXTRA_DIST): Add ChangeLog.1.
4886
4887 1999-12-05  Dale Worley  <worley@ariadne.com>
4888
4889         * src/compare.c (<utime.h>, struct utimbuf): Add.
4890         (diff_archive): Restore access times if --atime.
4891         * doc/tar.texi: Explain that --atime also preserves modification time.
4892
4893 1999-12-04  Gerhard Poul  <gpoul@gnu.org>
4894
4895         * ABOUT-NLS: Update to latest version from ftp.gnu.org.
4896         * BACKLOG, TODO: Remove.
4897         * Makefile.am (all-local, BABYL, dist-zoo, id, ID): Remove.
4898         * README: Bring up to date.
4899
4900 1999-12-03  Paul Eggert  <eggert@twinsun.com>
4901
4902         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.15.
4903
4904         * src/compare.c (diff_archive):
4905         Do not set errno to EPIPE; we no longer use perror.
4906
4907         * src/create.c (dump_file):
4908         If a parent directory said that a file should be there but it is
4909         absent, diagnose it as being removed in the meantime.
4910         Do not pass meaningless errno to ERROR when reporting that the
4911         file changed as we read it.
4912         Report that a file changed if its ctime changes; this is more
4913         sensitive than mtime+size, and more accurate.
4914
4915         * src/incremen.c (enum children): New type.
4916         (struct directory): Change old char allnew member to new enum children
4917         children member.
4918         All uses changed.
4919         (get_directory_contents): When doing an incremental dump that does
4920         not cross filesystem boundaries, dump the mount points, even though
4921         they are in a different filesystem.  This is for convenience when
4922         restoring, and for consistency with non-incremental dumps.
4923         This requires a 3-way flag for keeping track of which children we want,
4924         so we use enum children rather than boolean.
4925
4926         * src/open3.c (modes): Remove.
4927         (open3): Remove unportable assumptions about flag encodings.
4928         Use `stat' instead of `access' for testing file existence,
4929         to avoid problems with setuid programs.
4930
4931         * src/names.c (name_next): If file names are given both in the
4932         command line (e.g. via -C) and in a file (via -T), do not
4933         ignore the command-line names.
4934
4935         * m4/uintmax_t.m4: Backport to autoconf 2.13.
4936
4937         * doc/tar.texi: Clarify getdate authorship.
4938
4939 1999-11-23  Paul Eggert  <eggert@twinsun.com>
4940
4941         * lib/Makefile.am (DISTCLEANFILES): New macro.
4942
4943         * configure.in (tar_fnmatch_hin):
4944         Remove; it runs afoul of a bug in autoconf 2.13.
4945         Instead, always link fnmatch.h to some file, even if it's a throwaway.
4946
4947 1999-11-19  Paul Eggert  <eggert@twinsun.com>
4948
4949         * m4/largefile.m4: Update serial.
4950
4951 1999-11-18  Paul Eggert  <eggert@twinsun.com>
4952
4953         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a bug in
4954         the QNX shell, which doesn't propagate exit status of failed
4955         commands inside shell assignments.
4956
4957 1999-11-07  Paul Eggert  <eggert@twinsun.com>
4958
4959         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.14.
4960
4961         * configure.in (AC_PREREQ): Bump to 2.13.
4962         (ALL_LINGUAS): Add pt_BR, ja.
4963         (AC_FUNC_FNMATCH): Remove lib/funmatch.h before invoking, not after.
4964         (tar_cv_path_RSH): Prefer a non-symlink rsh to a symlink one,
4965         for AIX crossbuilds.
4966
4967         * doc/tar.texi: New node create options for --ignore-failed-read.
4968         Remove unused version control symbols.
4969         Modernize texinfo usage.
4970
4971         * src/tar.c (usage): Add examples.
4972
4973         * m4/fnmatch.m4 (AC_FUNC_FNMATCH):
4974         Include fnmatch.h when testing fnmatch.
4975
4976         * src/common.h (collect_and_sort_names): New decl.
4977
4978         * src/list.c (from_header):
4979         Handle 32-bit two's complement negative time stamps
4980         even if the leading octal digit is 2 or 3.
4981
4982         * src/extract.c (set_stat): Remove duplicate code.
4983
4984         * src/create.c (to_chars): Remove trailing newline from warning.
4985         (dump_file): Ignore doors.
4986         (finish_header): Report block numbers with origin 0, not origin 1.
4987
4988         * src/rmt.c: Include getopt.h.
4989         (long_opts): New constant.
4990         (usage): New function.
4991         (main): Implement --help and --version.
4992         Output usage message if arguments are bad.
4993
4994 1999-10-10  Paul Eggert  <eggert@twinsun.com>
4995
4996         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.13.
4997
4998         * README: Remove --with-dmalloc.
4999         Add --disable-largefile.
5000         Remove old NeXT dirent problems, or AIX valloc problems.
5001         Remove old union wait advice, and old %lld advice.
5002         Remove advice about FreeBSD 2.1.7, ISC 4.1mu, Ultrix `make'.
5003
5004         * doc/tar.texi: Clarify documentation for portable file names.
5005
5006         * configure.in (AM_WITH_DMALLOC): Remove.
5007         (ALL_LINGUAS): Add ja.
5008
5009         * src/tar.c (decode_options):
5010         Invalid dates are now treated as (time_t) -1.
5011         Redo version message to conform to GNU standards.
5012
5013         * src/create.c (dump_file):
5014         Fix typo: last two args to dump_file were interchanged.
5015         * src/update.c (update_archive): Likewise.
5016
5017         * src/common.h (tartime): New decl.
5018
5019         * src/list.c (tartime): Now extern.
5020         (read_and): Invalid headers cause errors, not warnings.
5021
5022 1999-10-03  Paul Eggert  <eggert@twinsun.com>
5023
5024         * lib/getdate.y (__attribute__):
5025         Don't use if GCC claims to be before 2.8; this is
5026         needed for OPENStep 4.2 cc.  Also, don't use if strict ANSI.
5027
5028 1999-09-25  Paul Eggert  <eggert@twinsun.com>
5029
5030         * lib/fnmatch.c, lib/fnmatch.hin: Merge changes from latest glibc.
5031         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Likewise.
5032
5033         * tests/incremen.sh: Add yet another sleep.
5034
5035 1999-09-24  Paul Eggert  <eggert@twinsun.com>
5036
5037         * NEWS: A read error now causes a nonzero exit status.
5038
5039         * src/create.c (to_chars): Fix base-256 output.
5040
5041         * src/buffer.c (write_error):
5042         Read error is an error, not just a warning.
5043
5044 1999-09-24  Paul Eggert  <eggert@twinsun.com>
5045
5046         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.12.
5047
5048         * src/tar.c (<time.h>): Include.
5049         (time): Declare if not defined.
5050         (confirm): Don't read past EOF.
5051         (long_options, usage): Add --no-same-owner, --no-same-permissions.
5052         (main): Use clock_gettime if available.
5053
5054         * tests/Makefile.am (TESTS): Add incremen.sh
5055         (INCLUDES): Add -I../lib, for fnmatch.h.
5056
5057         * src/update.c (update_archive):
5058         Remove call to name_expand; had no effect.
5059         Use chdir_do to change into directory.
5060         Use deref_stat instead of stat.
5061         Use add_avoided_name to mark names to be avoided; the old method of
5062         setting a bit with the name caused all descendants of that name to
5063         be avoided, in some circumstances.
5064
5065         * tests/incremen.sh: Remove unnecessary sleeps.
5066
5067         * src/names.c (name_next): Go back to using plain chdir.
5068         (name_gather): Use chdir_arg to keep track of arguments to chdir.
5069         (addname): Likewise.
5070         (name_match): Use chdir_do to act on chdir args.
5071         (merge_sort): Moved here from incremen.c.
5072         (compare_names, add_hierarchy_to_namelist, collect_and_sort_names):
5073         Likewise.
5074         (name_expand): Remove.
5075         (name_from_list): Skip fake names.
5076         Use chdir_do to act on chdir args.
5077         (struct avoided_name): New struct.
5078         (avoided_names): New var.
5079         (add_avoided_name, is_avoided_name): New functions.
5080
5081         * src/system.h (stat, lstat): Define in terms of statx on
5082         STX_HIDDEN && !_LARGE_FILES /* AIX */ hosts.
5083         (UCHAR_MAX): New macro.
5084         (TYPE_MAXIMUM): Cast to arg type, for types narrow than int.
5085
5086         * m4/largefile.m4: Work around GCC 2.95.1 bug with HP-UX 10.20.
5087
5088         * src/incremen.c (<time.h>): Remove include; no longer used.
5089         (time): Remove decl.
5090         (time_now): Remove.
5091         (get_directory_contents): Use deref_stat.
5092         Consider a subdirectory to be all new only if
5093         listed_incremental_option or if it its timestamp is newer than the
5094         cutoff.
5095         (add_hierarchy_to_namelist, merge_sort): Move to names.c.
5096         (read_directory_file): Now extern.  Do not set time_now.
5097         (write_directory_file): Renamed from write_dir_file.
5098         Use start_time instead of time_now.
5099         (compare_names, collect_and_sort_names): Move to names.c.
5100
5101         * src/mangle.c (<time.h>): Remove; not used.
5102         (time): Do not declare.
5103
5104         * src/misc.c (chdir_from_initial_wd): Remove.
5105         (deref_stat): New function.
5106         (struct wd): New struct.
5107         (wd, wds, wd_alloc): New variables.
5108         (chdir_arg, chdir_do): New function.
5109
5110         * src/compare.c (get_stat_data): Use deref_stat.
5111
5112         * src/common.h (name_expand): Remove.
5113
5114         * src/list.c (time): Declare if not defined.
5115         (base_64_digits): Moved here from create.c.
5116         (base64_map): Use UCHAR_MAX for size, not less-clear (unsigned char)
5117         -1.
5118         (read_and): Don't get time from header unless we need it now;
5119         as getting time can cause duplicate diagnostics if bogus.
5120         Remove "Hmm, " from diagnostic.
5121         Use "Skipping to next header" uniformly.
5122         (from_header): Renamed from from_chars.  All uses changed.
5123         Allow different forms for unportable 2's complement numbers.
5124         Don't check for extended forms when parsing checksums.
5125         Parse base-256 output.
5126         (gid_from_header): Renamed from gid_from_chars.  All uses changed.
5127         (major_from_header): Renamed from major_from_chars.  All uses changed.
5128         (minor_from_header): Renamed from minor_from_chars.  All uses changed.
5129         (mode_from_header): Renamed from mode_from_chars.  All uses changed.
5130         (off_from_header): Renamed from off_from_chars.  All uses changed.
5131         (size_from_header): Renamed from size_from_chars.  All uses changed.
5132         (time_from_header): Renamed from time_from_chars.  All uses changed.
5133         Warn about future timestamps.
5134         (uid_from_header): Renamed from uid_from_chars.  All uses changed.
5135         (uintmax_from_header): Renamed from uintmax_from_chars.
5136         All uses changed.
5137         (tartime): New function, incorporating isotime.
5138         (isotime): Delete.
5139         (print_header): Use tartime.
5140
5141         * src/create.c (to_chars): Fix typo in decl.
5142         Don't assign through char const *.
5143         Rename name_expand back to collect_and_sort_names.
5144
5145         * src/extract.c (<time.h>): No need to include.
5146         (time): No need to declare.
5147         (now): Remove variable.
5148         (extr_init): Don't initialize `now'.
5149         Increment same_permissions_option and same_owner_option if we_are_root
5150         is nonzero; this supports the new --no-same-owner option.
5151         (set_stat): Use start_time instead of `now'.
5152
5153         * src/create.c (struct link): Remove unused linkcount member.
5154         (base_64_digits): Move to list.c.
5155         (base_8_digits): Remove.
5156         (to_octal): New function, with some of old contents of to_base.
5157         (to_base): Remove.
5158         (to_base256): New function.
5159         (to_chars): Use base 256, not base 64, for huge values.
5160         (mode_to_chars): Don't use two's complement in GNU format or POSIX
5161         format.
5162         (dump_file): Interchange last two arguments. If TOP_LEVEL is negative,
5163         it means we have an incremental dump where we don't know whether this
5164         is a top-level call.
5165         Use deref_stat instead of statx / stat / lstat.
5166         Cast result of alloca.
5167         Check for dates if 0 < top_level, not if listed_incremental_option.
5168         Move multiple-link check after directory check.
5169         Do not dump avoided names.
5170         Dump hard links to symbolic names as links, not as separate
5171         symbolic links.
5172         start_header cannot return a null pointer, so don't test for it.
5173         Likewise for find_next_block.
5174
5175         * src/buffer.c, src/common.h (<human.h>): Include.
5176         (read_error): Read error is an error, not just a warning.
5177         (print_total_written): Also print human-readable byte count, and
5178         bytes/s.
5179         (open_archive, flush_write): Use start_time, not current time.
5180         (flush_read): Report about garbage bytes ignored at end of archive,
5181         but act on non-garbage bytes (instead of ignoring them).
5182         (new_volume): Use WARN for warnings.
5183
5184         * doc/Makefile.am:
5185         ($(srcdir)/tar.info): Add -I$(srcdir) so that subdir builds work.
5186
5187         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/fnmatch.m4.
5188
5189         * m4/Makefile.am (EXTRA_DIST): Add fnmatch.m4.
5190
5191         * lib/Makefile.am (noinst_HEADERS):
5192         Rename fnmatch.h to fnmatch.hin; add human.h.
5193         (libtar_a_SOURCES): Add human.c, xstrtoul.c.
5194         (INCLUDES): Remove -I.. -I$(srcdir) -- automake adds this for us.
5195
5196         * src/Makefile.am (rmt_LDADD, tar_LDADD): New macros.
5197
5198         * lib/fnmatch.c (strchrnul):
5199         Define to __strchrnul if _LIBC, to our own replacement otherwise.
5200         Do not define if !_LIBC and if it already exists.
5201         (internal_fnmatch): Use it.
5202
5203         * configure.in (tar_LDADD): New variable, used only when linking tar.
5204         (rmt_LDADD): Similarly, for rmt.
5205         (AC_FUNC_FNMATCH): Link fnnmatch.hin to fnmatch.h if we're using our
5206         fnmatch.c; otherwise, use the system fnmatch.h.
5207
5208         * doc/tar.texi: Add --no-same-owner, --no-same-permissions.
5209         Modernize sample backup script.
5210
5211         * THANKS: Martin Goik's email address has changed.
5212
5213         * m4/fnmatch.m4: New file.
5214
5215 1999-09-03  Paul Eggert  <eggert@twinsun.com>
5216
5217         * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
5218         Use EINVAL instead.
5219
5220 1999-08-29  Paul Eggert  <eggert@twinsun.com>
5221
5222         * lib/getdate.y (get_date):
5223         Rename outermost local `probe' to `quarter'.
5224         Rename latter local `tm' to probe_tm.
5225         From: Jim Meyering <meyering@ascend.com>
5226         Message-ID: <uryn1vafyyc.fsf@ixi.eng.ascend.com>
5227
5228 1999-08-28  Paul Eggert  <eggert@twinsun.com>
5229
5230         * lib/getdate.y (PC): New macro; use it when possible.
5231         (number): Handle `Nov 11 1996' example correctly.
5232         See Risks Digest 20.55 (1999-08-27)
5233         http://catless.ncl.ac.uk/Risks/20.55.html#subj18
5234
5235 1999-08-23  Paul Eggert  <eggert@twinsun.com>
5236
5237         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.11.
5238
5239         Remove minor cases of lint from many source files: this includes
5240         unnecessary casts, uses of NULL, etc.
5241
5242         * configure.in (AC_PROG_YACC): Remove.
5243         (YACC): Always use bison.
5244         (AC_STRUCT_TIMEZONE): Add.
5245         (AC_REPLACE_FUNCS): Add strcasecmp, strncasecmp.
5246
5247         * doc/tar.texi: --bzip2 is now -I.  Remove obsolete time zone info.
5248         Fix spelling.
5249
5250         * lib/Makefile.am (EXTRA_DIST): Add strcasecmp.c, strncasecmp.c.
5251         ($(srcdir)/getdate.c): Rename y.tab.c to getdate.c only if successful.
5252
5253         * lib/strcasecmp.c, lib/strncasecmp.c: New files.
5254
5255         * src/common.h (merge_sort): Remove decl; no longer exported.
5256
5257         * src/system.h (voidstar): Remove.
5258         (memcpy, memcmp): Cast args.
5259         ("xalloc.h"): Add include.
5260         (xmalloc, xrealloc): Remove decl.
5261
5262         * src/mangle.c (time): Do not declare if defined.
5263         (first_mangle, mangled_num): Remove.
5264
5265         * src/list.c (from_chars): Report out-of-range values more precisely.
5266         (off_from_chars): Do not allow negative offsets.
5267         (uid_from_chars): Allow negative uids.
5268
5269         * src/create.c (linklist): Now static.
5270         (to_chars): Fix wording of message to match from_chars.
5271
5272         * src/misc.c (merge_sort): Move to incremen.c.
5273         * src/incremen.c (merge_sort): Move here from misc.c; now static.
5274         It's too painful to make it both generic and portable.
5275         (read_directory_file): "timestamp" -> "time stamp" in messages.
5276
5277         * src/tar.c (long_options, usage, main): -y is now -I (for --bzip).
5278         (usage): Fix misspelling.
5279         (OPTION_STRING): -y is now -I.
5280         (decode_options): Use -1, not EOF, for getopt_long result.
5281         Fix typo when invoking xstrtoumax: look for LONGINT_OK, not LONG_MAX.
5282         Handle operands after any "--" argument.
5283         (main): Report any output errors.
5284
5285         * src/rmt.c (main): status is ssize_t, not long.
5286
5287         * src/names.c (name_gather): Handle trailing -C option correctly.
5288         (addname): use memcpy, not strncpy, to copy a string of known length.
5289         (name_match): Handle trailing -C option correctly.
5290         Propagate -C option to following files.
5291         (name_match, name_scan): Remove redundant matching code.
5292
5293         * src/buffer.c (open_archive): Use American spelling in diagnostic.
5294
5295         * lib/getdate.y: Major rewrite.  Add copyright notice.
5296         (<stdio.h>): Include only if testing.
5297         (ISUPPER): Remove.
5298         (ISLOWER): New macro.
5299         (<string.h>): Include if HAVE_STRING_H, not USG.
5300         (bcopy): Remove.
5301         (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
5302         bison.
5303         (EPOCH_YEAR): Renamed from EPOCH.
5304         (table): Renamed from TABLE.
5305         (meridian): Now an anonymous enum.
5306         (struct parser_control): New type.
5307         (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
5308         (yyInput, ..., yyRelYear): Migrated into struct parser_control.
5309         (%pure_parser): Added, so that the parser is pure.
5310         (%union): Removed; the type is now just plain int.
5311         All %type directives removed.
5312         (tLOCAL_ZONE): New %token.
5313         (month_day_table): Renamed from MonthDayTable.
5314         (gmtime, localtime, mktime, time): Declare only if not defined.
5315         (meridian_table): New table.
5316         (dst_table): New table.
5317         (units_table): renamed from UnitsTable.
5318         (relative_time_table): Renamed from OtherTable.
5319         (time_zone_table): Renamed from TimezoneTable.  Modernized.
5320         (military_table): Renamed from MilitaryTable.
5321         (to_hour): Renamed from ToHour.
5322         (to_year): Renamed from ToYear.
5323         (lookup_zone): New function.
5324         (LookupWord): Renamed from lookup_word.  Use lookup_zone for time
5325         zones.
5326         (yylex): Now reentrant.  All callers changed.
5327         (get_date): Add support for local time zone abbreviations.
5328         Make it reentrant.
5329
5330 1999-08-20  Paul Eggert  <eggert@twinsun.com>
5331
5332         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.10.
5333
5334         * src/create.c (to_chars): Generate GNU base-64 representation
5335         if we are generating an old or new GNU format tar file for a
5336         number that can't be represented with the POSIX format.
5337
5338         * configure.in (AC_CHECK_FUNCS): Add fchdir.
5339         (AM_FUNC_GETLINE): Add.
5340         (LIBOBJS): Add getline.o to workaround comment.
5341         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/getline.m4.
5342         * m4/Makefile.am (EXTRA_DIST): Add getline.m4.
5343         * lib/Makefile.am (noinst_HEADERS): Add getline.h, save-cwd.h.
5344         (libtar_a_SOURCES): Add save-cwd.c, xgetcwd.c.
5345         * lib/getline.c, lib/getline.h, lib/save-cwd.c,
5346         lib/save-cwd.h, m4/getline.m4: New files.
5347
5348         * src/misc.c (<save-cwd.h>): Include.
5349         (chdir_from_initial_wd): New function.
5350
5351         * src/names.c (name_next): Use chdir_from_initial_wd, not chdir.
5352         (name_gather): Handle `-C x -C y' correctly.
5353         Do not rely on addname to handle -C.
5354         (addname): New CHANGE_DIR parameter.  All callers changed.
5355         Remove ugly calls to getcwd; no longer needed.
5356         (name_match, name_from_list): Use chdir_from_initial_wd, not chdir.
5357
5358         * src/incremen.c (listed_incremental_stream): New var.
5359         (read_directory_file): Remove arbitrary limits on file name length.
5360         Do not attempt to get the working directory; we can bypass this
5361         on fchdir hosts.  Open the listed_incremental_option file for both
5362         read and write instead of opening it twice.  Check for I/O errors
5363         when doing I/O to this file.  Check for invalid data in the file,
5364         and report line numbers of invalid data.
5365         (write_dir_file): Likewise.
5366         (collect_and_sort_names): Use chdir_from_initial_wd, not chdir.
5367         Do not invoke write_dir_file; that's our caller's responsibility.
5368
5369         * src/list.c (max): New macro.
5370         (isotime): Now takes time_t, not time_t *.  Report the decimal values
5371         of times that can't be broken down.
5372         (print_header): Don't assume that major and minor device numbers can
5373         fit into uintmax_t.
5374
5375         * src/common.h (struct name): change_dir is now char const *.
5376         (write_directory_file): Remove unused decl.
5377         (STRINGIFY_BIGINT): Assume b always points to UINTMAX_STRSIZE_BOUND
5378         chars; the old `sizeof (b)' broke when b was a pointer not an array.
5379         (chdir_from_initial_wd): New decl.
5380         (addname): New 2nd arg.
5381
5382         * THANKS: Torsten Lull -> Catrin Urbanneck
5383
5384 1999-08-18  Paul Eggert  <eggert@twinsun.com>
5385
5386         * configure.in (HAVE_GETHOSTENT, HAVE_SETSOCKOPT):
5387         Don't depend on ac_cv_func variables.
5388         From Albert Chin-A-Young <china@thewrittenword.com>.
5389
5390 1999-08-18  Paul Eggert  <eggert@twinsun.com>
5391
5392         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.9
5393
5394         * m4/signedchar.m4: New file.
5395         * configure.in (pe_AC_TYPE_SIGNED_CHAR): Add.
5396         * src/system.h (signed_char): New macro.
5397         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/signedchar.m4.
5398         * m4/Makefile.am (EXTRA_DIST): Add signedchar.m4.
5399
5400         * src/create.c (write_eot): Write at least two zero blocks.
5401
5402         * src/extract.c (extract_archive): Fix sparse array bug:
5403         we did not find end of array correctly.
5404
5405         * src/compare.c: (fill_in_sparse_array, diff_sparse_files):
5406         Don't assume find_next_block yields nonnull.
5407         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
5408         * src/list.c (skip_extended_headers): Likewise.
5409
5410         * src/list.c (read_and, list_archive): Simplify code.
5411         (read_header): Fix computation of signed checksums on machines where
5412         char is unsigned.
5413         Do not consider a block to be zero unless all its bytes are zero,
5414         even the checksum bytes.  Do not attempt to parse the checksum of
5415         a zero block.  Fix memory leak with long names and links.
5416         (from_chars): Accommodate a buggy tar that outputs leading NUL
5417         if the previous field overflows.
5418
5419         * src/misc.c (quote_copy_string): Generate \177 for '\177', not
5420         \?, for portability to non-ASCII hosts.
5421
5422 1999-08-16  Paul Eggert  <eggert@twinsun.com>
5423
5424         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.8.
5425
5426         * src/extract.c (make_directories): Do not chown intermediate
5427         directories, even if we are root.
5428
5429         * src/list.c (read_header): Fix bugs when interpreting
5430         POSIX-compliant headers that do not contain null bytes in the
5431         header or link names.
5432
5433 1999-08-14  Paul Eggert  <eggert@twinsun.com>
5434
5435         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.7.
5436
5437         * configure.in (AC_CHECK_HEADERS): Remove sys/wait.h.
5438         (AC_HEADER_SYS_WAIT): Add.
5439         (AC_REPLACE_FUNCS): Add waitpid.
5440         (tar_cv_header_union_wait, HAVE_UNION_WAIT): Remove.
5441         * lib/waitpid.c: New file.
5442         * lib/Makefile.am (EXTRA_DIST): Add waitpid.c.
5443         * src/system.h (WCOREDUMP): Remove; no longer used.
5444         (WIFSTOPPED): Likewise.
5445         (WEXITSTATUS, WIFSIGNALED): Default to Solaris 7 versions.
5446         * src/buffer.c (child_open_for_compress): Undo previous change.
5447         (close_archive): Use waitpid, POSIX-style, instead of old BSD style.
5448         (new_volume): Likewise.
5449
5450         * src/buffer.c, src/extract.c, src/incremen.c (time):
5451         Don't declare if defined.
5452         * src/extract.c (extr_init): Remove unneeded cast around 0 arg to time.
5453         * src/incremen.c (read_directory_file):
5454         Invoke `time' the same way everyone else does.
5455         Check validity of --listed-incremental file contents a bit better.
5456         Do not worry about --after-date-option; tar.c now checks this.
5457         * src/list.c (isotime): Report ??? if localtime returns null.
5458         Don't assume years fit into four digits.
5459         Don't append trailing newline.
5460         (print_header): Report ??? if localtime returns null;
5461         Don't assume years fit into four digits.
5462
5463         * src/compare.c (diff_archive): Do not fall back on absolute name
5464         when --absolute-names is not specified.
5465
5466         * src/create.c (start_header):
5467         Include text of ignored filesystem prefix in warning.
5468         (create_archive): Check for excluded names when doing incremental
5469         pass through directory.
5470         (dump_file): Do not dump old files explicitly given on command line
5471         when using --listed-incremental.  Do not strip ./ prefix from names.
5472
5473         * src/tar.c: -g now implies after_date_option = 1.
5474         -g and -N are now incompatible options.
5475
5476         * doc/tar.texi: Explain --exclude better.  Don't strip leading `./'.
5477
5478 1999-08-11  Jeff Dairiki  <dairiki@dairiki.org>
5479
5480         * src/list.c (read_header): Don't parse OLDGNU_FORMAT
5481         incremental headers as POSIX prefixes.
5482
5483 1999-08-11  Paul Eggert  <eggert@twinsun.com>
5484
5485         * NEWS, configure.in: Version 1.13.6.
5486
5487         * configure.in (ALL_LINGUAS): Add pt_BR.
5488         * po/pt_BR.po: New file.
5489
5490         * doc/Makefile.am ($(srcdir)/tar.info, $(srcdir)/header.texi):
5491         Renamed from tar.info and header.texi; adjust actions so that
5492         they work in other directories.
5493
5494         * doc/tar.texi: Add -y and --bzip2.
5495         Patterns containing / now exclude only file names whose prefix match.
5496
5497         * lib/exclude.h (excluded_filename): New option parameter.
5498         (add_exclude_file): New ADD_FUNC parameter.
5499         (excluded_pathname): Remove decl.
5500         * lib/exclude.c (_GNU_SOURCE):
5501         Remove; no longer needed since we don't use FNM_ macros.
5502         (excluded_filename): Renamed from excluded_filename_opts.
5503         (excluded_filename, excluded_pathname): Remove.
5504         (add_exclude_file): New ADD_FUNC parameter.
5505
5506         * po/POTFILES.in: Add lib/quotearg.c.
5507
5508         * src/buffer.c (_GNU_SOURCE): Define.
5509         (<fnmatch.h>): Include unconditionally.
5510         (child_open_for_compress): Dup after closing, to avoid possible file
5511         descriptor exhaustion.
5512         (flush_write): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
5513         (flush_read): Likewise.
5514
5515         * src/common.h (LG_8, LG_64): New macros.
5516         (excluded_with_slash, excluded_without_slash): New vars.
5517         (excluded): Remove.
5518         (base_64_digits): New decl.
5519         (gid_to_chars, major_to_chars, minor_to_chars, mode_to_chars,
5520         off_to_chars, size_to_chars, time_to_chars, uid_to_chars,
5521         uintmax_to_chars,
5522         GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS,
5523         OFF_TO_CHARS, SIZE_TO_CHARS, TIME_TO_CHARS, UID_TO_CHARS,
5524         UINTMAX_TO_CHARS):
5525         Renamed from gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
5526         off_to_oct, size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
5527         GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, OFF_TO_OCT,
5528         SIZE_TO_OCT, TIME_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT,
5529         respectively.  All definitions and uses changed.
5530         (excluded_name): New decl.
5531
5532         * src/compare.c (diff_archive):
5533         Open files with O_NONBLOCK instead of O_NDELAY.
5534
5535         * src/create.c (base_64_digits): New constant.
5536         (base_8_digits): New macro.
5537         (MAX_VAL_WITH_DIGITS): New macro.
5538         (to_base): First half of old to_oct.  Support base 64 too.
5539         (to_chars): Other half of old to_oct, for 64-bit support.
5540         (GID_NOBODY, UID_NOBODY): Don't define if the headers don't.
5541         (gid_substitute, uid_substitute): Look up names dynamically if
5542         GID_NOBODY and UID_NOBODY aren't defined; use -2 if all else fails.
5543         (mode_to_chars): Renamed from mode_to_oct.
5544         Support negative values in all the _to_chars functions.
5545         (start_header): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
5546         Abort if archive format is DEFAULT_FORMAT when it shouldn't be.
5547         (dump_file): Inspect entire pathname, not just new file name
5548         component, when deciding whether to exclude it.
5549
5550         * src/extract.c (extract_archive):
5551         Open files with O_NONBLOCK instead of O_NDELAY.
5552
5553         * src/incremen.c (get_directory_contents):
5554         Inspect entire pathname, not just new file name
5555         component, when deciding whether to exclude it.
5556
5557         * src/list.c (<fnmatch.h>): Do not include.
5558         (from_chars): Renamed from from_oct.  New parameter specifying
5559         the negative of the minimum allowed value.  Support negative
5560         and base-64 values.
5561         (base64_map): New var.
5562         (base64_init): New function.
5563         (print_header): Output numeric uids and gids if numeric_owner_option.
5564
5565         * src/misc.c (quote_copy_string): Use LG_8 instead of constants.
5566
5567         * src/names.c (_GNU_SOURCE): Define.
5568         (<fnmatch.h>): Include unconditionally.
5569         (excluded_name): New function, taking over duties of excluded_pathname.
5570         All uses changed.
5571
5572         * src/rmt.c (decode_oflag): New function.
5573         (main): Use it to support symbolic open flags.
5574
5575         * src/rtapelib.c (encode_oflag): New function.
5576         (rmt_open__): Do not allow newlines in the path.
5577         Propagate errno correctly.
5578         Decode symbolic open flags, if present.
5579
5580         * src/system.h (FILESYSTEM_PREFIX_LEN, ISSLASH, O_ACCMODE, O_NONBLOCK):
5581         New macros.
5582
5583         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
5584         New -y or --bzip2 option.
5585         (add_filtered_exclude): New function.
5586         (decode_options): Put excluded patterns with / into
5587         excluded_with_slash, and without / into excluded_without_slash.
5588         Compare newer_mtime_option to its new initial value
5589         TYPE_MINIMUM (time_t) when deciding whether more than one
5590         threshold date was specified.
5591
5592 1999-07-20  Paul Eggert  <eggert@twinsun.com>
5593
5594         * NEWS, configure.in: Version 1.13.5.
5595
5596         * src/common.h (FATAL_ERROR): Invoke apply_delayed_set_stat
5597         before exiting.
5598         * src/buffer.c (new_volume): Likewise.
5599         * src/incremen.c (read_directory_file): Likewise.
5600         * src/tar.c (decode_options):
5601         ERROR ((TAREXIT_FAILURE, ... -> FATAL_ERROR ((0,
5602         for consistency.
5603
5604         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.4.
5605         * configure.in (AC_CHECK_FUNCS): Add lstat, readlink, symlink.
5606
5607         * src/system.h (lstat): Define only if !HAVE_LSTAT && !defined lstat.
5608         (S_ISMPB, S_ISMPC, S_ISNWK): Remove unused macros.
5609         (S_ISBLK, S_ISCHR, S_ISCTG, S_ISFIFO, S_ISLNK, S_ISSOCK):
5610         Define to 0 if the corresponding S_IF* macro is not defined.
5611         (mkfifo): Do not define if already defined, or if S_IFIFO
5612         is not defined.
5613
5614         * src/compare.c (diff_archive): Use HAVE_READLINK, not
5615         S_ISLNK, to determine whether to invoke readlink.
5616         * src/create.c (dump_file): Likewise.
5617
5618         * src/extract.c (set_mode):
5619         Do not chmod unless we are root or the -p option was given;
5620         this matches historical practice.
5621         (unlink_destination): New function, which checks for unlink failures.
5622         (maybe_recoverable): Stay quiet if -U.
5623         (extract_archive): Use O_EXCL if unlink_first_option.
5624         Report unlink failures.
5625         Use HAVE_SYMLINK, not S_ISLNK, to determine whether symlink exists.
5626         Use HAVE_MKFIFO || defined mkfifo, not S_ISFIFO, to determine whether
5627         mkfifo exists.
5628
5629         * src/incremen.c (get_directory_contents): Depend on
5630         S_ISHIDDEN, not AIX, to determine whether to invoke S_ISHIDDEN.
5631
5632         * src/list.c: Remove S_IS* ifdefs.
5633         * src/misc.c (maybe_backup_file): Likewise.
5634
5635         * src/misc.c (maybe_backup_file):
5636         "Virtual memory exhausted" -> "Memory exhausted",
5637         to conform to the other places this message is issued.
5638
5639         * src/mangle.c (extract_mangle):
5640         Replace #ifdef S_ISLNK with #ifdef HAVE_SYMLINK.
5641
5642         * src/rtapelib.c (rmt_open__):
5643         Remove typo that caused us to omit the first char
5644         of the basename.
5645
5646 1999-07-16  Paul Eggert  <eggert@twinsun.com>
5647
5648         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.13.3.
5649
5650         * doc/tar.texi: A path name is excluded if any of its file name
5651         components matches an excluded pattern, even if the path name was
5652         specified on the command line.
5653         * src/create.c (create_archive): Likewise.
5654         * src/list.c (read_and): Likewise.
5655         * src/update.c (update_archive): Likewise.
5656         * lib/exclude.h (excluded_pathname): New decl.
5657         * lib/exclude.c (_GNU_SOURCE): Define.
5658         (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros.
5659         (excluded_filename_opts): New function.
5660         (excluded_pathname): New function.
5661
5662         * lib/Makefile.am (EXTRA_DIST):
5663         xstrtol.c moved here from libtar_a_SOURCES.
5664         (libtar_a_SOURCES): Move xstrtol.c to EXTRA_DIST.
5665         Remove xstrtoul.c; no longer needed.
5666         * lib/xstrtol.c: Remove.
5667
5668         * src/tar.c (decode_options):
5669         Set newer_time_option to TYPE_MINIMUM, so that
5670         negative timestamps are handled correctly.
5671         Replace invocations of xstrtol and xstrtoul with xstrtoumax, for
5672         uniformity (and so that we don't need to have the other fns).
5673         (main): Remove call to init_total_written; no longer needed.
5674
5675         * configure.in (AC_CHECK_SIZEOF): Remove no-longer-needed
5676         checks for unsigned long and long long.
5677         * src/arith.c: Remove.
5678         * src/Makefile.am (tar_SOURCES): Remove arith.c.
5679         * po/POTFILES.in: Remove src/arith.c.
5680         * src/arith.h: Use double, to simplify configuration gotchas.
5681         (tarlong): Now double.
5682         (TARLONG_FORMAT): New macro.
5683         (BITS_PER_BYTE, BITS_PER_TARLONG, SUPERDIGIT, BITS_PER_SUPERDIGIT,
5684         LONGS_PER_TARLONG, SIZEOF_TARLONG, struct tarlong,
5685         zerop_tarlong_helper, lessp_tarlong_helper, clear_tarlong_helper,
5686         add_to_tarlong_helper, mult_tarlong_helper, print_tarlong_helper,
5687         zerop_tarlong, lessp_tarlong, clear_tarlong, add_to_tarlong,
5688         mult_tarlong, print_tarlong): Remove.  All callers replaced with
5689         arithmetic ops.
5690
5691         * src/common.h (init_total_written): Remove decl.
5692
5693         * src/buffer.c (total_written):
5694         Remove; replaced with prev_written + bytes_written.
5695         (prev_written): New var.
5696         (init_total_written): Remove.
5697         (print_total_written): Use TARLONG_FORMAT instead of print_tarlong.
5698
5699         * m4/ulonglong.m4 (jm_AC_TYPE_UNSIGNED_LONG_LONG):
5700         Make sure that we can shift, multiply
5701         and divide unsigned long long values; Ultrix cc can't do it.
5702
5703         * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned long.
5704         Check for any unknown bits, not just unknown bits left of the leftmost
5705         known bit.
5706
5707         * lib/quotearg.c (quotearg_buffer):
5708         Don't quote spaces if C quoting style.
5709         * src/list.c (from_oct):
5710         Use C quoting style for error; omit trailing NULs.
5711
5712 1999-07-14  Paul Eggert  <eggert@twinsun.com>
5713
5714         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.2.
5715
5716         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): Check whether
5717         <inttypes.h> defines strtoumax as a macro (and not as a function).
5718         HP-UX 10.20 does this.
5719
5720         * src/tar.c (usage): tar-bugs@gnu.org -> bug-tar@gnu.org
5721         * PORTS, README, TODO, doc/tar.texi: Likewise.
5722
5723 1999-07-12  Paul Eggert  <eggert@twinsun.com>
5724
5725         * configure.in (AM_INIT_AUTOMAKE): Version 1.13.1.
5726         (LIBOBJS): Add mktime.o to automake 1.4 bug workaround.
5727
5728         * src/list.c (decode_header):
5729         Do not assume that S_IFBLK and S_IFCHR are defined.
5730
5731         * src/create.c (start_header): Do not assume S_IFMT is defined.
5732         (dump_file): Remove unnecessary check for screwy apollo lossage.
5733         Do not assume S_IFBLK and S_IFCHR are defined.
5734
5735         * src/extract.c (extract_archive):
5736         Test whether S_IFCHR and S_IFBLK are nonzero,
5737         not whether they are defined, for consistency with other tests.
5738
5739         * src/buffer.c (is_regular_file):
5740         Don't succeed on files that we can't access due to
5741         permissions problems.
5742         (open_archive): Fix wording on fatal error message.
5743         Don't bother to stat /dev/null if the archive is not a character
5744         special device.
5745
5746         * src/compare.c (process_rawdata, diff_sparse_files, diff_archive):
5747         Report an error, not a warning, for I/O errors.
5748         (process_rawdata, process_dumpdir, diff_sparse_files):
5749         Change ungrammatical "Data differs" to "Contents differ".
5750         (get_stat_data): Find hidden files on AIX.
5751         Accept file name as argument; all uses changed.
5752         (get_stat_data, diff_archive): Use system error message for
5753         nonexistent files rather than rolling our own.
5754         (diff_archive): Unknown file types are errors, not warnings.
5755         Normalize spelling of message to "File type differs".
5756         Use get_stat_data to get link status, for consistency.
5757         Do not inspect st_rdev for fifos.
5758         Do not assume st_mode values contain only file types and mode bits.
5759         Check for mode changes and device number changes separately.
5760
5761         * src/update.c (append_file):
5762         Open the file before statting it, to avoid a race.
5763         Complain about file shrinkage only when we reach EOF.
5764
5765 1999-07-08  Paul Eggert  <eggert@twinsun.com>
5766
5767         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13 released.
5768
5769         * configure.in (AC_EXEEXT): Add.
5770
5771         * lib/Makefile.am (noinst_HEADERS):
5772         Add basename.h, exclude.h.  Remove full-write.h.
5773         (libtar_a_SOURCES): Add exclude.c.
5774
5775         * lib/basename.h, lib/exclude.c, lib/exclude.h, lib/safe-read.h:
5776         New files.
5777         * lib/full-write.c: Include safe-read.h instead of full-write.h.
5778         * lib/safe-read.h (safe_read): New decl.
5779         * src/rmt.c: Include safe-read.h.
5780         * src/rtapelib.c: Include basename.h, save-read.h.
5781         (rmt_open__): Use base_name to compute base name.
5782
5783         * src/common.h:
5784         Include basename.h, exclude.h; don't include full-write.h.
5785         (exclude_option): Remove decl.
5786         (excluded): New decl.
5787         (add_exclude, add_exclude_file, check_exclude): Remove decls.
5788
5789         * src/list.c (read_and):
5790         Use excluded_filename instead of check_exclude.
5791         Check base name of incoming file name, not entire file name, when
5792         deciding whether to exclude it.
5793
5794         * src/create.c (finish_sparse_file):
5795         Use excluded_filename instead of check_exclude.
5796         Don't bother to stat excluded file names.
5797         * src/incremen.c (get_directory_contents): Likewise.
5798
5799         * src/names.c (exclude_pool, exclude_pool_size,
5800         allocated_exclude_pool_size, simple_exclude_array,
5801         simple_excludes, allocated_simple_excludes,
5802         pattern_exclude_array, pattern_excludes,
5803         allocated_pattern_excludes, add_exclude, add_exclude_file,
5804         check_exclude):
5805         Remove; now done in ../lib/exclude.c.
5806
5807         * src/tar.c (decode_options): Initialize `excluded'.
5808         Use new add_exclude_file and add_exclude functions.
5809
5810 1999-07-05  Paul Eggert  <eggert@twinsun.com>
5811
5812         * m4/gettext.m4: Use changequote rather than [[ ]].
5813
5814         * lib/safe-read.c: Renamed from lib/full-read.c.
5815         (safe_read): Renamed from full_read.  All uses changed.
5816         * lib/safe-read.h, lib/full-write.h: New files.
5817         * lib/Makefile.am (noinst_HEADERS): Add full-write.h, safe-read.h.
5818         (libtar_a_SOURCES): Rename full-read.c to safe-read.c.
5819         * lib/full-write.c: Include full-write.h.
5820         * src/common.h: Include full-write.h, safe-read.h.
5821         * src/system.h: (full_read, full_write): Remove decls.
5822
5823         * src/Makefile.am (datadir): New var; needed for Solaris gettext.
5824
5825         * src/system.h (bindtextdomain, textdomain): undef before
5826         defining, to avoid preprocessor warnings with --disable-nls
5827         on hosts whose locale.h includes libintl.h.
5828
5829         * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
5830         expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
5831         (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
5832         the above decl.
5833
5834 1999-07-02  Paul Eggert  <eggert@twinsun.com>
5835
5836         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/mktime.m4.
5837         * m4/mktime.m4: New file.
5838         * m4/Makefile.am.in, m4/README: Remove these files.
5839         * m4/Makefile.am (EXTRA_DIST): Add mktime.m4;
5840         remove README, Makefile.am.in.
5841         (Makefile.am): Remove rule; it didn't work in BSD/OS 4.0.
5842         * m4/jm-mktime.m4 (jm_FUNC_MKTIME): Invoke AC_FUNC_MKTIME,
5843         not AM_FUNC_MKTIME.
5844
5845         * src/tar.c: Include signal.h.
5846         (SIGCHLD): Define to SIGCLD if SIGCLD is defined but SIGCHLD is not.
5847         (main): Ensure SIGCHLD is not ignored.
5848
5849         (BACKUP_OPTION, DELETE_OPTION, EXCLUDE_OPTION, GROUP_OPTION,
5850         MODE_OPTION, NEWER_MTIME_OPTION, NO_RECURSE_OPTION, NULL_OPTION,
5851         OWNER_OPTION, POSIX_OPTION, PRESERVE_OPTION, RECORD_SIZE_OPTION,
5852         RSH_COMMAND_OPTION, SUFFIX_OPTION, USE_COMPRESS_PROGRAM_OPTION,
5853         VOLNO_FILE_OPTION, OBSOLETE_ABSOLUTE_NAMES,
5854         OBSOLETE_BLOCK_COMPRESS, OBSOLETE_BLOCKING_FACTOR,
5855         OBSOLETE_BLOCK_NUMBER, OBSOLETE_READ_FULL_RECORDS, OBSOLETE_TOUCH,
5856         OBSOLETE_VERSION_CONTROL): Make sure they can't be valid chars, so
5857         they don't overlap with char codes.  Use an enum instead of a lot
5858         of #defines.
5859
5860         * src/system.h (ISASCII): Remove.
5861         (CTYPE_DOMAIN, ISDIGIT, ISODIGIT, ISPRINT, ISSPACE, S_ISUID,
5862         S_ISGID, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP,
5863         S_IROTH, S_IWOTH, S_IXOTH, MODE_WXUSR, MODE_R, MODE_RW,
5864         MODE_RWX, MODE_ALL, SEEK_SET, SEEK_CUR, SEEK_END, CHAR_MAX,
5865         LONG_MAX): New macros.
5866
5867         * src/incremen.c (ISDIGIT, ISSPACE): Remove; now in system.h.
5868         (read_directory_file): Cast ISSPACE arg to unsigned char.
5869         * src/misc.c (ISPRINT): Remove; now in system.h.
5870         (remove_any_file): Add brackets to pacify gcc -Wall.
5871         * src/list.c: Don't include <ctype.h>; system.h already does this.
5872         (ISODIGIT, ISSPACE): Remove; now in system.h.
5873         (decode_header): No need to AND mode with 07777; MODE_FROM_OCT
5874         does this now.
5875         (from_oct): Cast ISSPACE arg to unsigned char.
5876
5877         * src/create.c (mode_to_oct): Translate modes from internal to
5878         external form.
5879         * src/list.c (mode_from_oct): Translate modes from external to
5880         internal form.  Do not complain about unrecognized mode bits.
5881         * src/common.h (TSUID, TSGID, TSVTX, TUREAD, TUWRITE, TUEXEC,
5882         TGREAD, TGWRITE, TGEXEC, TOREAD, TOWRITE, TOEXEC): Remove undefs.
5883
5884         * src/extract.c: (extr_init, make_directories, extract_archive):
5885         Do not assume mode bits have traditional Unix values.
5886         * src/list.c (decode_mode): Likewise.
5887         * src/create.c (start_header, dump_file): Likewise.
5888         * src/buffer.c (child_open_for_compress,
5889         child_open_for_uncompress, open_archive, (close_archive): Likewise.
5890         * src/compare.c (diff_archive): Likewise.
5891
5892         * src/extract.c (set_mode): Use %04 not %0.4 format.
5893         (extract_sparse_file): Do not use data_block uninitialized.
5894         Check for lseek failures.
5895
5896         * src/rtapelib.c (rmt_lseek__):
5897         Convert lseek whence values to portable integers on the wire.
5898         * src/rmt.c (main): Likewise.  Check for whence values out of range.
5899
5900         * src/create.c (finish_sparse_file): Use lseek whence macros
5901         instead of integers.
5902         * src/buffer.c (backspace_output): Likewise.
5903         * src/compare.c (diff_archive, verify_volume): Likewise.
5904         * src/delete.c (move_archive): Likewise.
5905         * src/extract.c (extract_sparse_file): Likewise.
5906
5907         * src/create.c (dump_file): Do not invoke finish_sparse_file
5908         on a negative file descriptor.
5909
5910         * src/buffer.c: Add braces to pacify gcc -Wall.
5911
5912         * src/compare.c (diff_sparse_files): Report lseek errors.
5913
5914         * configure.in (ALL_LINGUAS): Add cs, es, ru.
5915
5916         * PORTS, TODO: gnu.ai.mit.edu -> gnu.org
5917
5918         * src/arith.c, src/buffer.c (new_volume): Don't put ^G in
5919         message to be internationalized; \a doesn't work with msgfmt.
5920
5921         * src/tar.c (long_options, main, usage, OPTION_STRING):
5922         Remove -E or --ending-file.
5923         * src/list.c (read_and): Likewise.
5924         * src/common.h (ending_file_option): Likewise.
5925         * src/buffer.c (close_archive): Likewise.
5926
5927         * tests/after: Don't run two commands together in a pipeline,
5928         as some old shells mishandle pipeline exit status.
5929
5930 1999-06-28  Paul Eggert  <eggert@twinsun.com>
5931
5932         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64015.
5933         * NEWS: Describe changes since 1.12.
5934         * README: Update bug reporting address; move paxutils ref to NEWS.
5935
5936         Handle EINTR correctly.
5937         * lib/Makefile.am (libtar_a_SOURCES): Add full-read.c, full-write.c.
5938         * lib/full-read.c, lib/full-write.c: New files.
5939         * src/buffer.c (child_open_for_compress, child_open_for_uncompress):
5940         Prefer full_read to read and full_write to write.
5941         * src/compare.c (process_rawdata, diff_sparse_files): Likewise.
5942         * src/create.c (deal_with_sparse, finish_sparse_file, dump_file):
5943         Likewise.
5944         * src/extract.c (extract_sparse_file): Likewise.
5945         * src/rmt.c (get_string, main, report_error_message,
5946         report_numbered_error): Likewise.
5947         * src/rmt.h (rmtread, rmtwrite): Likewise.
5948         * src/rtapelib.c (do_command, get_status_string, rmt_read__,
5949         rmt_write__, rmt_ioctl__): Likewise.
5950         * src/update.c (append_file): Likewise.
5951         * src/system.h (full_read, full_write): New decls.
5952
5953         * po/POTFILES.in: Add lib/argmatch.c, lib/error.c lib/getopt.c,
5954         lib/xmalloc.c, src/arith.c, src/misc.c.
5955
5956         * src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
5957         New macros.  All uses of STDIN and STDOUT changed.
5958         * src/rmt.c (prepare_record_buffer, main): Use STDIN_FILENO
5959         instead of 0 and STDOUT_FILENO instead of 1.
5960         * src/rtapelib.c (_rmt_rexec): Use STDIN_FILENO and STDOUT_FILENO
5961         instead of fileno (stdin) and fileno (stdout) or 0 and 1.
5962
5963         * src/rmt.c (private_strerror): Avoid const.  Translate results.
5964
5965         * tests/Makefile.am (TESTS): Remove incremen.sh; it doesn't work
5966         in the presence of NFS clock skew.
5967
5968 1999-06-25  Paul Eggert  <eggert@twinsun.com>
5969
5970         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64014.
5971
5972         * src/buffer.c (write_archive_buffer): New function.
5973         (child_open_for_compress, flush_write, flush_read): Use it to write
5974         buffers.
5975         (open_archive): Report error if fstat of archive fails.
5976         Improve efficiency of check for /dev/null.
5977         Also, fix some corner cases with remote archives and /dev/null checking.
5978         (close_archive): Test for input fifo only if not remote.
5979         Truncate output archive only if it's not remote.
5980
5981         * src/misc.c (remove_any_file):
5982         Don't terminate if you see . or ..; just skip them.
5983
5984 1999-06-18  Paul Eggert  <eggert@twinsun.com>
5985
5986         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64013.
5987
5988         Output sizes using a format that's more compatible with
5989         traditional tar (and with GNU Emacs).
5990         * src/common.h (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT,
5991         MODE_TO_OCT, SIZE_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT):
5992         Don't subtract 1 from size.
5993         * src/create.c (to_oct): Prepend leading zeros, not spaces.
5994         Output a trailing NUL unless the value won't fit without it.
5995         (finish_header): No need to append NUL to chksum, now that
5996         to_oct is doing it.
5997
5998 1999-06-16  Paul Eggert  <eggert@twinsun.com>
5999
6000         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64012.
6001
6002         * src/Makefile.am (LDADD): Link libtar.a after @INTLLIBS@, since
6003         @INTLLIBS@ might invoke rpl_realloc.
6004
6005         * src/tar.c (backup_type): Remove decl; backupfile.h now has it.
6006         (intconv): Remove; use xstrto* fns instead.
6007         ("xstrtol.h"): Include.
6008         (check_decimal): Remove.
6009         (long_options, usage, OPTION_STRING, decode_options):
6010         Remove -y, --bzip2, --unbzip2.
6011         (decode_options): Use xget_version instead of get_version.
6012         Check for overflow with -b and -L and RECORD_SIZE_OPTION.
6013         Replace invocations of check_decimal  with xstrtoumax.
6014
6015         * tests/preset.in (echo_n, echo_c): Remove.
6016
6017         * tests/after: Don't rely on $echo_c and $echo_n.
6018
6019         * lib/addext.c, lib/dirname.c, lib/lchown.c, lib/lchown.h,
6020         lib/malloc.c, lib/mktime.c, lib/realloc.c, lib/strtol.c, lib/strtoul.c,
6021         lib/strtoull.c, lib/strtoumax.c, lib/utime.c, lib/xstrtol.c,
6022         lib/xstrtol.h, lib/xstrtoul.c, lib/xstrtoumax.c,
6023         m4/Makefile.am.in, m4/README, m4/ccstdc.m4, m4/d-ino.m4,
6024         m4/gettext.m4, m4/inttypes_h.m4, m4/isc-posix.m4,
6025         m4/jm-mktime.m4, m4/largefile.m4, m4/lcmessage.m4,
6026         m4/malloc.m4, m4/progtest.m4, m4/realloc.m4, m4/uintmax_t.m4,
6027         m4/ulonglong.m4, m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4,
6028         m4/xstrtoumax.m4: New files.
6029
6030         * configure.in(fp_PROG_ECHO): Remove; no longer needed.
6031         (AC_SYS_LARGEFILE): Renamed from AC_LFS.
6032         (jm_AC_HEADER_INTTYPES_H): Replaces inline code.
6033         (jm_STRUCT_DIRENT_D_INO, jm_AC_TYPE_UINTMAX_T, jm_AC_PREREQ_XSTRTOUMAX): Add.
6034         (AC_CHECK_FUNCS): Remove lchown.
6035         (AC_REPLACE_FUNCS): Remove basename, dirname.
6036         Add lchown, strtol, strtoul.
6037         (jm_FUNC_MKTIME): Add.
6038         (LIBOBJS): Replace .o with $U.o, so that the .o files in LIBOBJS
6039         are also built via the ANSI2KNR-filtering rules.
6040         Use a no-op line to work around bug in automake 1.4 with malloc and
6041         realloc.
6042         (AC_OUTPUT): Add m4/Makefile.
6043
6044         * lib/Makefile.am (EXTRA_DIST):
6045         Add lchown.c, malloc.c, mktime.c, realloc.c,
6046         strtol.c, strtoul.c, strtoull.c, strtoumax.c, utime.c.
6047         (noinst_HEADERS): Add lchown.h, modechange.h, xstrtol.h.
6048         (libtar_a_SOURCES): Add addext.c, basename.c, xstrtol.c,
6049         xstrtoul.c, xstrtoumax.c.  Remove getversion.c.
6050         ($(srcdir)/getdate.c:): Remove `expect conflicts' line.
6051
6052         * src/system.h (uintmax_t): Don't declare; configure now does this.
6053
6054         * src/common.h (backup_type): New decl.
6055         * src/common.h, src/misc.c, src/tar.c:
6056         Move include of backupfile.h to common.h.
6057
6058         * src/misc.c (maybe_backup_file):
6059         Pass backup_type to find_backup_file_name.
6060
6061         * src/list.c (print_header): Change sizes of uform and gform from 11 to
6062         UINTMAX_STRSIZE_BOUND.
6063
6064         * doc/tar.texi: Remove --bzip2.
6065         Fix @xref typos reported by latest makeinfo.
6066
6067         * Makefile.am (ACLOCAL_AMFLAGS): New macro.
6068         (SUBDIRS): Add m4.
6069         (M4DIR, ACINCLUDE_INPUTS): New macros.
6070         ($(srcdir)/acinclude.m4): New rule.
6071
6072         * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT,
6073         HAVE_INTTYPES_H, HAVE_LC_MESSAGES, HAVE_STPCPY): Remve #undefs;
6074         now generated automatically by autoconf.
6075
6076 1999-05-15  Paul Eggert  <eggert@twinsun.com>
6077
6078         * doc/tar.texi: Remove -y.
6079
6080 1999-04-09  Paul Eggert  <eggert@twinsun.com>
6081
6082         * src/system.h (INT_STRLEN_BOUND): Fix off-by-factor-of-10 typo
6083         (we were allocating too much storage).
6084         (uintmax_t): Don't declare; configure now does this.
6085
6086         * ABOUT-NLS: Update to gettext 0.10.35 edition.
6087
6088 1999-03-22  Paul Eggert  <eggert@twinsun.com>
6089
6090         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64010
6091
6092         * acinclude.m4 (AC_LFS_FLAGS):
6093         Don't use -mabi=n32 with GCC on IRIX 6.2; it's the default.
6094         (AC_LFS): -n32, -o32, and -n64 are CPPFLAGS, not CFLAGS.
6095         (jm_FUNC_MALLOC, jm_FUNC_REALLOC): New macros.
6096
6097         * configure.in (jm_FUNC_MALLOC, jm_FUNC_REALLOC):
6098         New macros; needed for latest GNU xmalloc.c.
6099
6100         * Makefile.am (noinst_HEADERS): Add quotearg.h, xalloc.h.
6101         (libtar_a_SOURCES): Add quotearg.c.
6102         * list.c: Include <quotearg.h>.
6103         (from_oct): Add forward decl.
6104         (read_header): Return HEADER_FAILURE if we can't parse the checksum.
6105         (from_oct): Report an error only if TYPE is nonzero.
6106         Quote any funny characters in bad header.
6107
6108 1999-03-20  Paul Eggert  <eggert@twinsun.com>
6109
6110         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64009
6111
6112         * acinclude.m4 (AC_LFS_FLAGS): Add support for IRIX 6.2 and later.
6113         (AC_LFS_SPACE_APPEND): Assume $2 is quoted properly; all callers
6114         changed.
6115         (AC_LFS): Simplify AIX revision number test.
6116
6117 1999-03-17  Paul Eggert  <eggert@twinsun.com>
6118
6119         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64008
6120
6121         * configure.in (AC_VALIDATE_CACHED_SYSTEM_TUPLE):
6122         Remove; it doesn't work that well
6123         with AC_CANONICAL_HOST.
6124         (fp_WITH_INCLUDED_MALLOC): Remove; we'll just use the system malloc.
6125
6126         * Makefile.am (EXTRA_DIST): Remove AC-PATCHES, AM-PATCHES, BI-PATCHES.
6127
6128         * Makefile.am (EXTRA_DIST): Remove gmalloc.c.
6129
6130         * acinclude.m4 (fp_WITH_INCLUDED_MALLOC): Remove.
6131
6132         * tar.texi: Fix bug-report addr.
6133
6134         * README: Remove --with-included-malloc.
6135         Upgrade version numbers of build software.
6136
6137 1999-03-07  Paul Eggert  <eggert@twinsun.com>
6138
6139         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64007.
6140
6141         * acinclude.m4 (AM_WITH_NLS): Port to Solaris 2.5.1,
6142         where bindtextdomain and gettext require -lintl.
6143         (AC_LFS_FLAGS): Simplify so that it only gets the flags;
6144         `no' means it failed.
6145         (AC_LFS_SPACE_APPEND, AC_LFS_MACRO_VALUE): New macros.
6146         (AC_LFS): Use them.  Set _FILE_OFFSET_BITS, _LARGEFILE_SOURCE, and
6147         _LARGE_FILES from LFS_CFLAGS, so that in the normal case we don't need
6148         to add anything to the command line (it's all in config.h).
6149         Put any extra -D and -I options into CPPFLAGS, the rest into CFLAGS.
6150
6151 1999-03-01  Paul Eggert  <eggert@twinsun.com>
6152
6153         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64006.
6154
6155         * acinclude.m4 (AC_LFS_FLAGS): Port to AIX 4.2.
6156
6157         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
6158         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
6159         uid_from_oct, uintmax_from_oct): Use TYPE_MAXIMUM instead of macros
6160         like OFF_MAX, which are not reliable
6161         (e.g. OFF_MAX in AIX 4.2 is incorrect).
6162         * src/system.h (GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX, OFF_MAX,
6163         SIZE_MAX, TIME_MAX,UID_MAX, UINTMAX_MAX):  Remove; no longer used.
6164
6165         * src/incremen.c (get_directory_contents):
6166         Don't use statx if _LARGE_FILES; it doesn't work under AIX 4.2.
6167         Have statx depend on STX_HIDDEN, not AIX.
6168
6169         * src/create.c (to_oct):
6170         New parameter substitute, giving a substitute value to use
6171         when the original value is out of range.  Do not append a space to the
6172         output; modern tars don't.  When a value is out of range, specify the
6173         maximum value, not the number of bits.
6174         (GID_NOBODY, UID_NOBODY): New macros.
6175         (gid_to_oct, uid_to_oct): Use them as substitutes.
6176         (finish_header): Do not assume that UINTMAX_TO_OCT appends a space.
6177         (dump_file): Check whether the file changed as we read it.
6178
6179         * src/rmt.c (main): Remove suspicious AIX/386 code.
6180
6181 1999-02-19  Paul Eggert  <eggert@twinsun.com>
6182
6183         * intl/localealias.c (read_alias_file): Don't assume that memcpy
6184         returns a type compatible with char *; it doesn't on SunOS
6185         4.1.4 with Sun cc, since <string.h> doesn't declare memcpy.
6186
6187         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64005.
6188
6189         * src/tar.c (long_options, usage): Prefer --unbzip2 to --bunzip2.
6190         * doc/tar.texi: Add --bzip2, --unbzip2 options.
6191
6192         * configure.in (AC_CANONICAL_HOST, AC_VALIDATE_CACHED_SYSTEM_TUPLE):
6193         Add.
6194         (AC_LINK_FILES): Omit; AM_GNU_GETTEXT now does this.
6195         (AC_OUTPUT): Omit munging of po/Makefile; AM_GNU_GETTEXT now does this.
6196         * acinclude.m4 (AM_WITH_NLS):
6197         Update to latest gettext version (serial 5).
6198         (AC_LFS_FLAGS): New macro
6199         (AC_LFS): Use it.  Append to CFLAGS, LDFLAGS, LDLIBS instead of
6200         working only with unset variables.  Append to CFLAGS, not CPPFLAGS.
6201         Work properly in cross-compilation scenario, by checking for getconf
6202         with AC_CHECK_TOOL and by ditching uname in favor of
6203         AC_CANONICAL_HOST and $host_os.  Add --disable-lfs option.
6204
6205         * lib/getdate.y: Update to fileutils 4.0 getdate.y, with one patch:
6206         replace FORCE_ALLOCA_H with HAVE_ALLOCA_H.
6207         * lib/Makefile.am (AUTOMAKE_OPTIONS): Append ../src/ansi2knr,
6208         since getdate.y now uses ANSI code.
6209
6210         * config.guess, config.sub: New files; taken from automake 1.4.
6211
6212         * intl/Makefile.in, intl/VERSION, intl/bindtextdom.c,
6213         intl/cat-compat.c, intl/dcgettext.c, intl/dgettext.c,
6214         intl/explodename.c, intl/finddomain.c, intl/gettext.c,
6215         intl/gettext.h, intl/gettextP.h, intl/hash-string.h,
6216         intl/l10nflist.c, intl/libgettext.h, intl/loadinfo.h,
6217         intl/loadmsgcat.c, intl/localealias.c, intl/textdomain.c:
6218         Update to GNU gettext 0.10.35, with patches as per GCC snapshot 990109.
6219
6220 1999-02-01  Paul Eggert  <eggert@twinsun.com>
6221
6222         * src/tar.c: Update copyright.
6223
6224         * NEWS: 1.12.64004
6225
6226 1999-02-01  Paul Eggert  <eggert@twinsun.com>
6227
6228         * NEWS, configure.in: Version 1.12.64004
6229
6230         * configure.in (AC_LFS): Use this macro, instead of open-coding it.
6231
6232         * acinclude.m4 (AC_LFS, AM_PROG_CC_STDC): New macros.
6233
6234         * src/extract.c (extract_archive): Fix bug when extracting sparse
6235         files: they were trashing the tar file header.
6236
6237         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
6238         Add -y or --bzip2 or --bunzip2 option.
6239
6240 1999-01-30  Paul Eggert  <eggert@twinsun.com>
6241
6242         * src/names.c (cached_no_such_uname, cached_no_such_gname,
6243         cached_no_such_uid, cached_no_such_gid): New vars.
6244         (uid_to_uname, gid_to_gname, uname_to_uid, gname_to_gid):
6245         Cache failures, too.
6246
6247         * src/tar.c (decode_options):
6248         Don't pass names longer than UNAME_FIELD_SIZE to
6249         uname_to_uid, as it messes up the cache.  Similarly for gname_to_uid.
6250
6251 1999-01-27  Paul Eggert  <eggert@twinsun.com>
6252
6253         * NEWS, configure.in: Version 1.12.64003
6254
6255         * src/buffer.c (backspace_output, close_archive):  Cast
6256         rmtlseek position arg to off_t, for benefit of K&R compilers
6257         with long long.
6258         * src/compare.c (verify_volume): Likewise.
6259
6260         * NEWS, configure.in: Version 1.12.64002
6261
6262         * src/create.c (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
6263         off_to_oct, size_to_oct, time_to_oct, uid_to_oct):
6264         Cast arg to uintmax_t for benefit of pre-ANSI compilers with long long.
6265         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
6266         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
6267         uid_from_oct): Likewise.
6268
6269 1999-01-25  Paul Eggert  <eggert@twinsun.com>
6270
6271         * incremen.sh: Fix timing bug in regression test.
6272
6273 1999-01-22  Paul Eggert  <eggert@twinsun.com>
6274
6275         * NEWS, configure.in: Update version
6276
6277         * Makefile.am (localedir): Change to $(datadir)/locale.
6278         (DEFS): New macro, defining LOCALEDIR.
6279         (tar.o, tar._o, rmt.o, rmt._o): Remove.
6280         (INCLUDES): Add -I..
6281
6282         * Makefile.am (localedir): Change to $(datadir)/locale.
6283
6284 1999-01-21  Paul Eggert  <eggert@twinsun.com>
6285
6286         * NEWS, README, configure.in: Unofficial version 1.12.64001.
6287
6288         * tests/Makefile.am (localedir): Change to $(datadir)/locale.
6289         * src/Makefile.am (localedir): Likewise.
6290         (DEFS): New macro, defining LOCALEDIR.
6291         (tar.o, tar._o, rmt.o, rmt._o): Remove.
6292         (INCLUDES): Add `-I..'.
6293
6294         * tests/incremen.sh: Fix timing bug.
6295
6296 1999-01-20  Paul Eggert  <eggert@twinsun.com>
6297
6298         * NEWS, README, configure.in: Unofficial version 1.12.64000.
6299         `lfs.7' changed to `64000' in version number
6300         to conform to gnits standards.
6301
6302         * COPYING, INSTALL, doc/texinfo.tex, install-sh, missing,
6303         mkinstalldirs, ansi2knr.c: Update to latest public versions.
6304
6305         Rebuild with automake 1.4 and autoconf 2.13, to work around some
6306         porting problems.
6307
6308 1998-12-07  Paul Eggert  <eggert@twinsun.com>
6309
6310         * NEWS, README, configure.in: Unofficial version 1.12.lfs.6.
6311
6312         * src/list.c (read_header):
6313         Accept file names as specified by POSIX.1-1996 section 10.1.1.
6314
6315 1998-11-30  Paul Eggert  <eggert@twinsun.com>
6316
6317         * configure.in: Quote the output of uname.
6318
6319         * src/extract.c (set_stat): chmod after chown even when not root;
6320         if we are using --same-owner this is needed e.g. on Solaris 2.5.1.
6321
6322 1998-11-15  Paul Eggert  <eggert@twinsun.com>
6323
6324         * NEWS, README, configure.in: Unofficial version 1.12.lfs.5.
6325
6326         * configure.in (ac_test_CPPFLAGS, ac_test_LDFLAGS, ac_test_LIBS,
6327         ac_getconfs, ac_result): Special case for HP-UX 10.20 or later.
6328
6329 1998-10-28  Paul Eggert  <eggert@twinsun.com>
6330
6331         * NEWS, README, configure.in: Unofficial version 1.12.lfs.4.
6332
6333         * src/system.h (voidstar): Use void * if __STDC__ is defined,
6334         not merely nonzero.
6335
6336         * src/rtapelib.c: Don't use rexec code unless compiled with WITH_REXEC.
6337         On many installations, rexec is disabled.
6338
6339 1998-08-07  Paul Eggert  <eggert@twinsun.com>
6340
6341         * NEWS, README, configure.in: Unofficial version 1.12.lfs.3.
6342
6343         * src/names.c (uid_to_uname, gid_to_gname): Don't used cached name
6344         for nameless users and groups.
6345
6346 1998-02-17  Paul Eggert  <eggert@twinsun.com>
6347
6348         * NEWS, README, configure.in: Unofficial version 1.12.lfs.2.
6349         * NEWS, README: Add explanation of why this isn't an official version.
6350
6351 1998-02-02  Paul Eggert  <eggert@twinsun.com>
6352
6353         * NEWS, README, configure.in: Unofficial version 1.12.lfs.1.
6354         This is an unofficial version.
6355
6356 1997-12-17  Paul Eggert  <eggert@twinsun.com>
6357
6358         * src/incremen.c (ST_DEV_MSB): New macro.
6359         (NFS_FILE_STAT): Use most significant bit of st_dev,
6360         even if it's unsigned.
6361
6362 1997-12-08  Paul Eggert  <eggert@twinsun.com>
6363
6364         * src/system.h (ST_NBLOCKS): Fix typo in definition.
6365
6366 1997-11-19  Paul Eggert  <eggert@twinsun.com>
6367
6368         * configure.in (HAVE_INTTYPES_H):
6369         Don't ignore cache variable if it's already set.
6370
6371 1997-11-10  Paul Eggert  <eggert@twinsun.com>
6372
6373         * src/rmt.c (main): Don't assume mt_count is of type daddr_t.
6374         * src/delete.c (records_read): Now off_t.
6375         (move_archive): Don't assume mt_count is of type daddr_t.
6376
6377 1997-10-30  Paul Eggert  <eggert@twinsun.com>
6378
6379         * configure.in (CPPFLAGS, LDFLAGS, LIBS):
6380         Set to appropriate values if large file support
6381         needs explicit enabling.
6382         (HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING, daddr_t, major_t, minor_t,
6383         ssize_t):
6384         New macros to configure.
6385         (AC_TYPE_MODE_T, AC_TYPE_PID_T, AC_TYPE_OFF_T): Add.
6386
6387         * acconfig.h (daddr_t, HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING,
6388         major_t, minor_t, ssize_t): New macros.
6389
6390         * src/arith.h (TARLONG_FORMAT):
6391         Fix typo: %uld -> %lu.  Use unsigned when long long
6392         (%lld -> %llu).
6393         (add_to_tarlong_helper, mult_tarlong_helper): 2nd arg is now unsigned long.
6394         (add_to_tarlong, mult_tarlong): Cast 2nd arg to unsigned long.
6395
6396         * src/arith.c (add_to_tarlong_helper, mult_tarlong_helper):
6397         2nd arg is now unsigned long.
6398
6399         * src/rmt.c (allocated_size): Now size_t, and now initialized to 0.
6400         (prepare_record_buffer): Arg is now size_t.
6401         Remove now-useless casts.
6402
6403         (main): Use `long' for status, so that it can store ssize_t.
6404         Use daddr_t, mode_t, size_t, off_t when appropriate.
6405         Convert daddr_t and off_t values ourselves, since they might be longer
6406         than long.  Convert other types using `long' primitives.
6407         When processing MTIOCTOP, do not try to pass resulting
6408         count back, since it won't work (it could be too large) and it's
6409         not expected anyway.
6410
6411         * src/update.c:
6412         (append_file) Use off_t, size_t, ssize_t when appropriate.  Remove
6413         now-useless casts.  Use unsigned long to print *_t types, except use
6414         STRINGIFY_BIGINT for off_t.
6415         (update_archive): Cast -1 to dev_t when necessary.
6416
6417         * src/tar.c (check_decimal):
6418         Now returns 1 if successful, 0 otherwise, and returns
6419         uintmax_t value into new arg.  Check for arithmetic overflow.
6420         (decode_options): Avoid overflow if record_size fits in size_t but not int.
6421         Check for overflow on user or group ids.
6422
6423         * src/compare.c (diff_init, process_rawdata, read_and_process,
6424         diff_sparse_files, diff_archive):
6425         Use off_t, pid_t, size_t, ssize_t when appropriate.
6426         Remove now-useless casts.  Use unsigned long to print *_t types,
6427         except use STRINGIFY_BIGINT for off_t.
6428
6429         (process_noop, process_rawdata, process_dumpdir, read_and_process):
6430         Size arg is now size_t.
6431
6432         (diff_sparse_files): Arg is now off_t.  Check for size_t overflow
6433         when allocating buffer.
6434
6435         * src/rtapelib.c:
6436         (do_command, rmt_open__, rmt_read__, rmt_lseek__, rmt_ioctl__):
6437         Use pid_t, size_t, ssize_t when appropriate.  Remove now-useless casts.
6438         Use unsigned long to print *_t types, except use STRINGIFY_BIGINT for
6439         off_t.
6440
6441         (get_status_string, get_status_off): New function.
6442         (get_status): Now returns long, so that it can store ssize_t.
6443         Invoke get_status_string to do the real work.
6444         (rmt_read__, rmt_write__): Now returns ssize_t. Size arg is now size_t.
6445         (rmt_lseek__): Now returns off_t, using new get_status_off function.
6446         (rmt_ioctl__): Convert mt_count by hand,
6447         since it might be longer than long.
6448
6449         * src/mangle.c (extract_mangle):
6450         Check for overflow when converting off_t to size_t.
6451         Use off_t, size_t when appropriate.  Remove now-useless casts.
6452
6453         * src/system.h (mode_t): Remove; now done by autoconf.
6454         (ST_NBLOCKS): Do not overflow if st_size is near maximum.
6455         Return number of ST_NBLOCKSIZE-byte blocks,
6456         not number of 512-byte blocks;
6457         this also helps to avoid overflow.
6458         (st_blocks): Declare if needed.
6459         (ST_NBLOCKSIZE): New macro.
6460         (<limits.h>, <inttypes.h>): Include if available.
6461         (CHAR_BIT): New macro.
6462         (uintmax_t): New typedef.
6463         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND,
6464         UINTMAX_STRSIZE_BOUND, GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX,
6465         OFF_MAX, SIZE_MAX, TIME_MAX, UID_MAX, UINTMAX_MAX): New macros.
6466
6467         * src/names.c (name_init):
6468         Fix typo in error message: FILE* was passed, but char*
6469         was wanted.
6470
6471         (read_name_from_file, name_gather, addname, name_match, name_scan,
6472         add_exclude): Use size_t when appropriate.  Remove now-useless casts.
6473
6474         (exclude_pool_size, allocated_exclude_pool_size): Now size_t.
6475
6476         * src/extract.c (newdir_umask, current_umask): Now mode_t.
6477         (extract_sparse_file): Args now use off_t.
6478
6479         (set_mode, set_stat, make_directories, extract_sparse_file,
6480         extract_archive): Use off_t, size_t, ssize_t when appropriate.  Remove
6481         now-useless casts.  Use unsigned long to print *_t types, except use
6482         STRINGIFY_BIGINT for off_t.
6483
6484         * src/misc.c (quote_copy_string):
6485         Use size_t when appropriate.  Remove now-useless casts.
6486
6487         * src/list.c (read_and, list_archive, read_header, decode_mode,
6488         print_header, print_for_mkdir):
6489         Use mode_t, off_t, size_t when appropriate.  Remove
6490         now-useless casts.  Use unsigned long to print *_t types, except use
6491         STRINGIFY_BIGINT for off_t.
6492
6493         (read_header): Check for overflow when converting header size.
6494
6495         (from_oct): Now static.  Now returns uintmax_t.  `where' arg is now
6496         const char *.  Size arg is now size_t.  Now takes new type and maxval
6497         args.  Compute result using uintmax_t, not long.  Report error if
6498         field does not contain octal number in range.
6499         (gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
6500         off_from_oct, size_from_oct, time_from_oct, uid_from_oct,
6501         uintmax_from_oct): New functions.
6502
6503         (stringify_uintmax_t_backwards): New function.
6504
6505         (decode_mode, print_for_mkdir): Mode arg is now mode_t.
6506         (skip_file): Offset arg is now off_t.
6507
6508         * src/buffer.c (record_start_block, save_totsize, save_sizeleft,
6509         real_s_totsize, real_s_sizeleft, current_block_ordinal):
6510         Now off_t.
6511         (write_error): Arg is now ssize_t.
6512         (child_pid): Now pid_t.
6513         (available_space_after): Now size_t.
6514
6515         (child_open_for_compress, child_open_for_uncompress, flush_write,
6516         open_archive, flush_write, write_error, flush_read, close_archive):
6517         Use pid_t, ssize_t, size_t when appropriate.  Remove now-useless
6518         casts.  Use unsigned long to print *_t types, except use
6519         STRINGIFY_BIGINT for off_t.
6520
6521         * src/delete.c (records_read): Now daddr_t.
6522         (move_archive): Arg is now daddr_t.  Check for overflow when
6523         computing offset.
6524         (move_archive, delete_archive_members): Use daddr_t, off_t when
6525         appropriate.  Remove now-useless casts.
6526
6527         * src/rmt.h (rmt_read__, rmt_write__): Now returns ssize_t.
6528         (rmt_lseek): Now returns off_t.
6529
6530         * src/create.c (to_oct):
6531         Now static.  Value arg is now uintmax_t.  Accept new args
6532         giving name of type of octal field, for error messages.  Report an
6533         error if the value is too large to fit in the field.
6534         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
6535         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct): New functions.
6536
6537         (write_eot, write_long, finish_header, deal_with_sparse,
6538         finish_sparse_file, dump_file): Use dev_t, off_t, ssize_t, size_t when
6539         appropriate.  Remove now-useless casts.  Use unsigned long to print
6540         *_t types, except use STRINGIFY_BIGINT for off_t.
6541
6542         (find_new_file_size): 1st arg is now off_t*.
6543         (finish_sparse_file): Args now use off_t, not long.
6544         Check for lseek error.
6545         (create_archive, dump_file): Cast -1 to dev_t when necessary.
6546         (dump_file): Device arg is now dev_t.
6547         Avoid overflow when testing whether file has holes
6548         by using the new ST_NBLOCKSIZE macro.
6549
6550         * src/incremen.c (struct accumulator, add_to_accumulator,
6551         get_directory_contents, add_hierarchy_to_namelist, gnu_restore):
6552         Use size_t for sizes.
6553         (struct directory, get_directory_contents, add_hierarchy_to_namelist):
6554         Use dev_t, ino_t for devices and inodes.
6555         (gnu_restore): Use off_t for file offsets.
6556         (struct directory): Use char for flags.  Add new flag `nfs'.
6557         (nfs): New constant
6558         (NFS_FILE_STAT): New macro.
6559         (note_directory): Accept struct stat * instead of
6560         device and inode number.  All callers changed.
6561         (note_directory, get_directory_contents):
6562         Use NFS_FILE_STAT to determine whether directory is an NFS directory.
6563         (write_dir_file): Cast time_t to unsigned long before printing as %lu.
6564
6565         * src/common.h (record_size, struct name, struct sp_array,
6566         available_space_after):
6567         Use size_t for sizes.
6568         (save_sizeleft, save_totsize, current_block_ordinal, skip_file):
6569         Use off_t for file offsets.
6570         (struct name): dir_contents is now const char *, not char *.
6571         (dump_file, get_directory_contents): Use dev_t for devices.
6572         (to_oct): Remove decl.
6573         (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, SIZE_TO_OCT,
6574         UID_TO_OCT, UINTMAX_TO_OCT, OFF_TO_OCT, TIME_TO_OCT, STRINGIFY_BIGINT,
6575         GID_FROM_OCT, MAJOR_FROM_OCT, MINOR_FROM_OCT, MODE_FROM_OCT,
6576         OFF_FROM_OCT, SIZE_FROM_OCT, TIME_FROM_OCT, UID_FROM_OCT,
6577         UINTMAX_FROM_OCT): New macros.
6578         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
6579         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
6580         stringify_uintmax_t_backwards, gid_from_oct, major_from_oct,
6581         minor_from_oct, mode_from_oct, off_from_oct, size_from_oct,
6582         time_from_oct, uid_from_oct, uintmax_from_oct): New decls.
6583         (print_for_mkdir): 2nd arg is now mode_t.
6584
6585 See ChangeLog.1 for earlier changes.
6586
6587
6588 \f
6589 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free Software
6590 Foundation, Inc.
6591
6592 This file is part of GNU tar.
6593
6594 GNU tar is free software; you can redistribute it and/or modify
6595 it under the terms of the GNU General Public License as published by
6596 the Free Software Foundation; either version 2, or (at your option)
6597 any later version.
6598
6599 GNU tar is distributed in the hope that it will be useful,
6600 but WITHOUT ANY WARRANTY; without even the implied warranty of
6601 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6602 GNU General Public License for more details.
6603
6604 You should have received a copy of the GNU General Public License
6605 along with GNU tar; see the file COPYING.  If not, write to
6606 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
6607 Boston, MA 02110-1301, USA.
6608 \f
6609 Local Variables:
6610 mode: change-log
6611 version-control: never
6612 End: