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