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