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