Implement window size passing between real tty and virtual console.
[dragonfly/vkernel-mp.git] / contrib / tar / ChangeLog
blob05906815bb6942f50d4f3a0c2dfa6a43d0b189d8
1 2001-09-26  Paul Eggert  <eggert@twinsun.com>
3         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.25.
5         * src/buffer.c (flush_read): Don't diagnose partial blocks before
6         end of file; just ignore them silently.
8         * src/list.c (read_header): Don't keep around extended name
9         and link info indefinitely; keep it only for the next file.
10         This fixes a bug introduced in 1.13.24, and removes the need
11         for some static variables.  Set recent_long_name and
12         recent_long_link to zero if there were no long links; this
13         avoids a violation of ANSI C rules for pointers in delete.c.
14         * THANKS: Add Christian Laubscher.
16 2001-09-26  Jim Meyering  <meyering@lucent.com>
18         * doc/tar.texi (Remote Tape Server): is know -> is known
20 2001-09-25  Paul Eggert  <eggert@twinsun.com>
22         * lib/unicodeio.c (EILSEQ): Include <iconv.h> first, since
23         <iconv.h> may define EILSEQ (e.g. libiconv).  Define a
24         replacement EILSEQ to be ENOENT, not EINVAL, since callers may
25         want to distinguish EINVAL and EILSEQ.
27 2001-09-24  Christophe Kalt  <Christophe.Kalt@kbcfp.com>
29         * src/extract.c (maybe_recoverable):
30         Treat OVERWRITE_OLD_DIRS like DEFAULT_OLD_FILES.
32 2001-09-22  Paul Eggert  <eggert@twinsun.com>
34         * NEWS, configure.ac (AM_INIT_AUTOMAKE): Version 1.13.24.
36         * ABOUT-NLS, intl/*: Update to gettext-0.10.40, replacing LGPL
37         with GPL.
39         * INSTALL, mkinstalldirs: Update to autoconf 2.52 version.
40         * PORTS: Add copyright notice, 'star' reference.
41         * README-alpha: Add copyright notice, autoconf 2.52 patch.
42         * THANKS: Add Christophe Kalt.
43         * config.sub: Upgrade to 2001-09-14 version.
45         * configure.ac (ALL_LINGUAS): Add ko.
46         * po/ko.po: Resurrected file.
48         * doc/convtexi.pl: Add coding advice for Emacs.
50         * doc/getdate.texi: Add copyright notice.
52         * doc/mdate-sh: Upgrade to automake 1.5 version.
54         * doc/tar.texi (extracting files): Mention --to-stdout.
55         (Option Summary, Dealing with Old Files): New option --overwrite-dir.
56         (Overwrite Old Files): Likewise.
58         * lib/Makefile.am (noinst_HEADERS):
59         Remove copysym.h.  Add print-copyr.h, unicodeio.h.
60         (libtar_a_SOURCES): Remove copysym.c, Add print-copyr.c, unicodeio.c.
62         * lib/copysym.c, lib/copysym.h: Remove.
63         * lib/print-copyr.c, lib/print-copyr.h, lib/unicodeio.c,
64         lib/unicodeio.h: New files.
66         * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
67         lib/mktime.c, lib/strtoll.c: Switch from LGPL to GPL.
69         * lib/quotearg.c (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
70         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
72         * m4/Makefile.am (EXTRA_DIST): Remove isc-posix.m4.
73         * m4/isc-posix.m4: Remove.
75         * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit.
77         * po/POTFILES.in: Add copyright notice.
79         * src/Makefile.am (LDADD): Like libtar.a before @INTLLIBS@ as
80         well as after.
81         * tests/Makefile.am (LDADD): Likewise.
83         * src/buffer.c (write_archive_buffer, close_archive):
84         If an archive is a socket, treat it like a FIFO.
85         (records_read, records_written): New vars.
86         (write_archive_to_stdout): Now bool, not int.
87         (open_archive, flush_write, flush_read): Keep records_read and
88         records_written up to date.
90         * src/common.h (enum old_files): New value OVERWRITE_OLD_DIRS.
91         (write_archive_to_stdout): Now bool, not int.
92         (enum read_header): New value HEADER_SUCCESS_EXTENDED.
93         (read_header): Now takes bool arg.  Existing callers modified
94         to pass 0, unless otherwise specified.
96         * src/delete.c (records_read): Remove; now a global.
97         (acting_as_filter): Now bool, not int.
98         (recent_long_name, recent_long_link, recent_long_name_blocks,
99         recent_long_link_blocks, records_read, records_written): New decls.
100         (records_skipped): New var.
101         (move_archive): Don't divide by zero if arg is 0.
102         Use the above vars to compute how far to move.
103         (write_recent_blocks): New function.
104         (delete_archive_member): Pass 1 to read_header, so that it doesn't
105         read more than 1 block.  Handle resulting HEADER_SUCCESS_EXTENDED code.
106         Keep track of how many records have been skipped.
107         Let the buffer code count records.
108         When copying a header, copy any extended headers that came before it.
110         * src/extract.c (extract_archive): When marking a directory to be
111         updated after symlinks, stat all directories after it in the
112         delayed-set-stat list too, since they will be checked after
113         symlinks.  Add support for --overwrite-dir.
115         * src/list.c (recent_long_name, recent_long_link,
116         recent_long_name_blocks, recent_long_link_blocks): New vars.
117         (read_and): Pass 0 to read_header.
118         (read_header): New arg RAW_EXTENDED_HEADERS.  Store away extended
119         headers into new vars.  Null-terminate incoming symbolic links.
121         * src/rmt.c: Include print-copyr.h, not copysym.h.
122         (main): Use print_copyright, not copyright_symbol.
123         * src/tar.c (decode_options): Likewise.
124         (OVERWRITE_DIR_OPTION): New constant.
125         (long_options, usage, decode_options): Add --overwrite-dir.
127         * src/tar.h: Put copyright notice into documentation.
129         * tests/Makefile.am (TESTS): Add delete03.sh.
130         * tests/delete03.sh: New file.
132         * tests/genfile.c: Include print-copyr.h, not copysym.h.
133         (main): Use print_copyright, not copyright_symbol.
134         Include <argmatch.h>.
135         (pattern_strings): Remove.
136         (pattern_args, pattern_types): New constants.
137         (main): Use XARGMATCH, not argmatch.
139 2001-09-20  Jim Meyering  <meyering@lucent.com>
141         * lib/xstrtol.c (strtoimax): Guard declaration with
142         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
143         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
144         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
145         (strtoumax): Likewise, for completeness (it wasn't necessary).
146         * m4/xstrtoimax.m4 (jm_AC_PREREQ_XSTRTOIMAX):
147         Check for declaration of strtoimax.
148         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
149         Check for declaration of strtoumax.
151 2001-09-16  Paul Eggert  <eggert@twinsun.com>
153         * fnmatch.m4 (jm_FUNC_FNMATCH): Fix typo in previous patch: yes -> no.
155 2001-09-14  Paul Eggert  <eggert@twinsun.com>
157         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.23.
159         * README-alpha: Describe automake patch.
161         * configure.ac (LIBOBJS):
162         Remove automake 1.4 workaround, as we're using 1.5 now.
163         (USE_INCLUDED_LIBINTL): New AC_DEFINE.
165         * lib/copysym.c: Include stddef.h, for size_t.
166         Include langinfo.h if needed.
167         Use locale_charset only if USE_INCLUDED_LIBINTL;
168         if not, use nl_langinfo (CODESET) if available.
170 2001-09-13  Paul Eggert  <eggert@twinsun.com>
172         * config.guess, config.sub: Sync with canonical versions.
174         * configure.ac (jm_PREREQ_XGETCWD): Add.
176         * lib/Makefile.am (noinst_HEADERS): Add copysym.h.
177         (libtar_a_SOURCES): Add copysym.c.
178         * copysym.c, copysym.h: New files.
180         * lib/error.c: Sync with fileutils version.
182         * m4/Makefile.am (EXTRA_DIST): Add getcwd.m4; remove uintmax_t.m4.
183         * m4/getcwd.m4: New file.
184         * m4/uintmax_t.m4: Remove.
186         * m4/gettext.m4 (AM_WITH_NLS):
187         Fix bug with calculating version of Bison 1.29.
188         Reported by Karl Berry.
190         * src/Makefile.am (datadir): Remove.
192         * src/rmt.c: Include copysym.h.
193         (main): Use copyright_symbol to translate copyright notice,
194         instead of gettext.
195         * src/tar.c: Likewise.
196         * tests/genfile.c: Likewise.
198         * src/system.h (MB_LEN_MAX): New symbol.
200 2001-09-11  Paul Eggert  <eggert@twinsun.com>
202         * src/extract.c (struct delayed_set_stat): New member
203         'after_symlinks'.
204         (delay_set_stat): Initialize it to 0.
205         (set_mode): New arg current_stat_info.  Use it (if nonnull) to avoid
206         taking an extra stat ourselves.  All callers changed.
207         (set_stat): Likewise.
208         (apply_nonancestor_delayed_set_stat): New arg 'after_symlinks'.
209         If false, stop when encountering a struct whose 'after_symlinks'
210         member is true.  Otherwise, go through all structures but check
211         them more carefully.  All callers changed.
212         (extract_archive): When extracting a deferred symlink, if its parent
213         directory's status needs fixing, then mark the directory as needing
214         to be fixed after symlinks.
215         (extract_finish): Fix status of ordinary directories, then apply
216         delayed symlinks, then fix the status of directories that are
217         ancestors of delayed symlinks.
219         * src/rtapelib.c (rexec):
220         Remove declaration; it ran afoul of prototypes on Crays.
221         Reported by Wendy Palm of Cray.
223 2001-09-06  Paul Eggert  <eggert@twinsun.com>
225         * lib/strtoimax.c (HAVE_LONG_LONG):
226         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
227         (strtoimax): Use sizeof (long), not
228         sizeof strtol (ptr, endptr, base),
229         to work around bug in IBM C compiler.
231 2001-09-04  Paul Eggert  <eggert@twinsun.com>
233         * lib/xgetcwd.c: Include "xalloc.h".
234         (xgetcwd): Do not return NULL when memory is exhausted; instead,
235         report an error and exit.
237         * m4/prereq.m4 (jm_PREREQ_XREADLINK): New macro.
238         (jm_PREREQ): Use it.
240 2001-09-03  Paul Eggert  <eggert@twinsun.com>
242         * m4/prereq.m4 (jm_PREREQ): Add jm_PREREQ_XGETCWD.
243         (jm_PREREQ_XGETCWD): New macro.
245         * lib/exclude.c (fnmatch_no_wildcards):
246         Fix typo that caused us to do case-folding
247         search even when that was not desired.  This occurred only in the
248         no-wildcard case.
250         * lib/xgetcwd.c: Include pathmax.h if not HAVE_GETCWD.
251         Do not include xalloc.h.
252         (INITIAL_BUFFER_SIZE): New symbol.
253         Do not use xmalloc / xrealloc, since the caller is responsible for
254         handling errors.  Preserve errno around `free' during failure.
255         Do not overrun buffer when using getwd.
257         * lib/xgetcwd.c (xgetcwd):
258         Use HAVE_GETCWD_NULL, not defined __GLIBC__ && __GLIBC__ >= 2,
259         to decide whether to use getcwd (NULL, 0).
261 2001-09-02  Paul Eggert  <eggert@twinsun.com>
263         * lib/xgetcwd.c: Fix typo in local var; from Jim Meyering.
265 2001-09-01  Jim Meyering  <meyering@lucent.com>
267         * exclude.c: Use `""', not `<>' to #include non-system header files.
268         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
269         and strncasecmp as r-values.  Unixware didn't have declarations.
271 2001-08-31  Jim Meyering  <meyering@lucent.com>
273         * lib/xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
274         Use an initial, malloc'd, buffer of length 128 rather than
275         a statically allocated one of length 1024.
277 2001-08-30  Paul Eggert  <eggert@twinsun.com>
279         * lib/utime.c: Include full-write.h.
280         * lib/xstrtol.c (strtoimax): New decl.
282 2001-08-29  Paul Eggert  <eggert@twinsun.com>
284         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.22.
286         * src/create.c (dump_file): Relativize link names before dumping.
287         This fixes a bug reported by Jose Pedro Oliveira.
289         * src/create.c (dump_file): Use offsetof when computing sizes for
290         struct hack; this avoids wasted space in some cases.
291         * src/incremen.c (note_directory, find_directory): Likewise.
292         * src/names.c (name_gather, addname): Likewise.
294         * src/extract.c (extract_archive): Use strcpy, not memcpy,
295         for consistency with other code that does similar things.
296         * src/names.c (name_gather): Likewise.
298         * src/names.c (read_name_from_file, name_next, name_gather,
299         add_hierarchy_to_namelist): Avoid quadratic behavior when
300         reallocating buffers.  Check for buffer size overflow.
301         (addname): Avoid unnecessary clearing of memory.
303 2001-08-29  "Jan D."  <Jan.Djarv@mbox200.swipnet.se>
305         * src/extract.c (delay_set_stat): Fix off-by-one error in file
306         name size allocation that caused core dumps.
308 2001-08-28  Paul Eggert  <eggert@twinsun.com>
310         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.21.
312         * configure.ac (GNU_SOURCE): Define to 1, not /**/.
313         (major_t, minor_t, ssize_t): Use new-style AC_CHECK_TYPE.
314         (daddr_t): Remove; no longer used.
315         (jm_PREREQ_HUMAN): Add.
317         * acconfig.h: Remove; no longer needed.
319         * config.guess, config.sub:
320         New files, from automake 1.5.  Gettext 0.10.39 needs them.
321         * depcomp, missing, mkinstalldirs: Upgrade to automake 1.5.
323         * Makefile.am (AUTOMAKE_OPTIONS): Add dist-bzip2.
324         (SUBDIRS): Put intl before lib, as gettext requires.
326         * ABOUT-NLS: Upgrade to gettext 0.10.39.
327         * intl: Upgrade entire directory to gettext 0.10.39.
328         * m4/codeset.m4, m4/glibc21.m4, m4/iconv.m4:
329         New files, from gettext 0.10.39.
330         * m4/gettext.m4, m4/isc-posix.m4, m4/lcmessage.m4, m4/progtest.m4,
331         Upgrade to gettext 0.10.39,
332         * po/Makefile.in.in: Likewise, except fix a typo in its copying
333         permissions.
334         * po/cat-id-tbl.c, po/stamp-cat-id:
335         Remove; no longer used by gettext 0.10.39.
336         * po/ChangeLog: New file.
338         * doc/Makefile.am (EXTRA_DIST): Add freemanuals.texi.
339         $(srcdir)/tar.texi: Likewise.
340         * doc/freemanuals.texi: New file.
341         * doc/tar.texi (Free Software Needs Free Documentation): New appendix.
342         `fileds' -> `fields'
343         * doc/texinfo.tex: Upgrade to version 2001-07-25.07.
345         * lib/Makefile.am (EXTRA_DIST): Add strtoll.c, strtoimax.c.
346         (noinst_HEADERS): Add quote.h.
347         (libtar_a_SOURCES): Add quote.c, xstrtoimax.c.
349         * lib/exclude.c: Fix typo in '#include <stdint.h>' directive.
351         * lib/full-write.c, lib/savedir.c: Comment fix.
353         * lib/pathmax.h: Remove.
355         * lib/quote.c, lib/quote.h: New files.
357         * lib/xgetcwd.c: Don't include pathmax.h.
358         Include stdlib.h and unistd.h if available.
359         Include xalloc.h.
360         (xmalloc, xstrdup, free): Remove decls.
361         (xgetcwd): Don't assume sizes fit in unsigned.
362         Check for overflow when computing sizes.
363         Simplify reallocation code.
365         * lib/xmalloc.c: Quote failure tests.
367         * lib/strtoumax.c, lib/xstrtoimax.c: New files.
369         * lib/strtoimax.c: Renamed from strtouxmax.c.  Make it more
370         similar to strtol.c.
371         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.
372         (verify): New macro.
373         (strtoumax, uintmax_t, strtoull, strtol): Remove.
374         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
375         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
376         changed to signed values.  Check sizes at compile-time, not
377         run-time.  Prefer strtol to strtoll if both work.
378         (main): Remove.
380         * lib/xstrtol.h (xstrtoimax): New decl.
382         * m4/Makefile.am (EXTRA_DIST):
383         Add codeset.m4, glibc21.m4, iconv.m4, inttypes.m4,
384         longlong.m4, xstrtoimax.m4.
386         * m4/inttypes.m4 (jm_AC_HEADER_INTTYPES_H):
387         Remove; now done by autoconf.
388         (jm_AC_TYPE_INTMAX_T, jm_AC_TYPE_UINTMAX_T): Replace with
389         Use AC_CHECK_TYPE instead of merely looking for the header.
391         * m4/uintmax_t.m4: Use shorter comment.
393         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX):
394         Quote first arg of AC_DEFUN.
395         Require jm_AC_TYPE_INTMAX_T and jm_AC_TYPE_LONG_LONG since they
396         is needed to parse the include file.
397         Simplify logic behind the args to AC_REPLACE.
399         * src/Makefile.am (OMIT_DEPENDENCIES): Remove.
401         * src/ansi2knr.1, src/ansi2knr.c: Remove; wasn't being used.
403         * src/rmt.c (main):
404         Use "Copyright %d" to simplify the translator's job in the future.
405         Advise translator about circle-C.
406         * src/tar.c: (decode_options): Likewise.
407         * tests/genfile.c (main): Likewise.
409 2001-08-28  Jim Meyering  <meyering@lucent.com>
411         * lib/argmatch.c: Include "quote.h".
412         (argmatch_invalid): Quote the context.
414         * lib/dirname.c (dir_name): Fix typo on PC platforms.
416         * lib/backupfile.c, lib/basename.c, lib/dirname.c, lib/strtoul.c:
417         Use single-quote for local .h files.
419         * lib/error.h (__attribute__): Don't depend on __STRICT_ANSI__.
421         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Upgrade to recent
422         glibc versions.
424         * lib/getdate.y (get_date): Initialize tm_isdst to -1 before
425         invoking mktime the last time.
427         * lib/pathmax.h: Use #if rather than #ifdef for HAVE_UNISTD_H.
429         * lib/rename.c: Major rewrite by Volker Borchert to use system
430         rename function, but to work around problems with trailing
431         slashes.
433         * lib/strtoll.c: New file, from glibc.
434         * lib/strtoul.c: Update from glibc.
436         * lib/strtouxmax.c: Renamed from lib/strtoumax.c.
437         Add support for signed numbers, too.
438         (strtoul, strtoull): Do not declare if STRTOUXMAX_UNSIGNED
439         is not defined.
440         (strtol, strtoll): Declare as needed, if STRTOUXMAX_UNSIGNED is
441         not defined.
442         (strtoumax, uintmax_t, strtoull, strtoul): New macros.
443         (main): Use generic names in debugging output.
444         * lib/strtoimax.c: Plus add the following changes of my own:
445         (main): Use accurate names in debugging output.
447         * lib/xgetcwd.c (xgetcwd): Use getcwd if glibc 2 or later.
448         Don't use PATH_MAX.
450         * m4/c-bs-a.m4, m4/check-decl.m4, m4/d-ino.m4, m4/error.m4,
451         m4/getline.m4, m4/jm-mktime.m4, m4/malloc.m4, m4/mbrtowc.m4,
452         m4/mbstate_t.m4, m4/realloc.m4, m4/uintmax_t.m4, m4/utimbuf.m4,
453         m4/utime.m4, m4/utimes.m4:
454         Quote the first argument in each use of AC_DEFUN.
456         * m4/getline.m4: Don't use string.h.
458         * m4/inttypes.m4, m4/longlong.m4, m4/xstrtoimax.m4: New files.
460         * m4/mbrtowc.m4 (jm_FUNC_MBRTOWC): @%:@ -> #.
462 2001-08-27  Paul Eggert  <eggert@twinsun.com>
464         * NEWS, configure.ac (AC_INIT_AUTOMAKE): Version 1.13.20.
466         The biggest change is the new --exclude semantics and options.
467         The basic idea was suggested by Gerhard Poul; thanks!
469         * NEWS: Describe new --exclude semantics and options, and bug fixes.
470         * README: ignfail.sh fails on some NFS hosts.
471         * NEWS, README, lib/xstrtol.h: Add copyright notice.
473         * Makefile.am (ACLOCAL_AMFLAGS): Add -I m4.
474         (M4DIR, ACINCLUDE_INPUTS, $(srcdir)/acinclude.m4):
475         Remove; the automake bug has been fixed.
476         * acinclude.m4: Remove.
478         * configure.ac: Renamed from configure.in.
479         (AC_PREREQ): Bump from 2.13 to 2.52.
480         (ALL_LINGUAS): Add id, tr.  Remove ko, as po/ko.po (dated
481         1997-05-30) has an encoding error.
482         (jm_AC_HEADER_INTTYPES_H): Remove; now done by autoconf.
483         (AC_FUNC_FNMATCH): Use AC_CONFIG_LINKS, not AC_LINK_FILES.
485         * doc/fdl.texi: Update to current GNU version.
487         * doc/tar.texi: Put leading '*' in direntry.
488         Accommodate new gfdl sectioning.
489         New option --recursion (the default) that is the inverse of
490         --no-recursion.
492         New options --anchored, --ignore-case, --wildcards,
493         --wildcards-match-slash, and their negations (e.g., --no-anchored).
494         Along with --recursion and --no-recursion, these control how exclude
495         patterns are interpreted.  The default interpretation of exclude
496         patterns is now --no-anchored --no-ignore-case --recursion
497         --wildcards --wildcards-match-slash.
499         * lib/Makefile.am (OMIT_DEPENDENCIES): Remove.
501         * lib/exclude.c (bool): Declare, perhaps by including stdbool.h.
502         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
503         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
504         Include if available.
505         (<xalloc.h>): Include
506         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
507         (verify): New macro.  Use it to verify that EXCLUDE macros do not
508         collide with FNM macros.
509         (struct patopts): New struct.
510         (struct exclude): Use it, as exclude patterns now come with options.
511         (new_exclude): Support above changes.
512         (new_exclude, add_exclude_file):
513         Initial size must now be a power of two to simplify overflow checking.
514         (free_exclude, fnmatch_no_wildcards): New function.
515         (excluded_filename): No longer requires options arg, as the options
516         are determined by add_exclude.  Now returns bool, not int.
517         (excluded_filename, add_exclude):
518         Add support for the fancy new exclusion options.
519         (add_exclude, add_exclude_file): Now takes int options arg.
520         Check for arithmetic overflow when computing sizes.
521         (add_exclude_file): xrealloc might modify errno, so don't
522         realloc until after errno might be used.
524         * lib/exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
525         New macros.
526         (free_exclude): New decl.
527         (add_exclude, add_exclude_file): Now takes int options arg.
528         (excluded_filename): No longer requires options arg, as the options
529         are determined by add_exclude.  Now returns bool, not int.
531         * lib/prepargs.c: Include <string.h>; required for C99 since
532         we use strlen.
534         * lib/quotearg.c:
535         BSD/OS 4.1 wchar.h requires FILE and struct tm to be declared.
537         * lib/xstrtol.h (_DECLARE_XSTRTOL): Improve quality of
538         diagnostic for LONGINT_INVALID_SUFFIX_CHAR.
540         * m4/Makefile.am (EXTRA_DIST): Add check-decl.m4, mbrtowc.m4.
541         Remove inttypes_h.m4, largefile.m4, mktime.m4.
543         * m4/inttypes_h.m4, m4/largefile.m4, m4/mktime.m4: Remove;
544         subsumed by Autoconf 2.50.
546         * m4/error.m4: Upgrade to serial 2.
548         * m4/fnmatch.m4 (jm_FUNC_FNMATCH): Upgrade to serial 4, but
549         remove test for GNU C library.  It's not correct, as some
550         older glibcs are buggy.
552         * m4/getline.m4, m4/malloc.m4: Upgrade to serial 4.
554         * m4/prereq.m4: Upgrade to serial 20, but then:
555         (jm_PREREQ): Add jm_PREREQ_EXCLUDE.
556         (jm_PREREQ_EXCLUDE): New macro.
557         (jm_PREREQ_HUMAN): Remove jm_AC_HEADER_INTTYPES_H, as it is subsumed
558         by autoconf 2.5x.
560         * m4/realloc.m4: Upgrade to serial 4.
562         * m4/strerror_r.m4: Revert to serial 1002.
564         * m4/uintmax_t.m4: Upgrade to autoconf 2.5x.
566         * m4/utimes.m4: Upgrade to latest version (still "serial 3").
568         * m4/xstrtoumax.m4: Upgrade to serial 3, but then:
569         (jm_AC_PREREQ_XSTRTOUMAX): Remove jm_AC_HEADER_INTTYPES_H, as
570         it is now subsumed by autoconf.  Add inttypes.h.
572         * po/cs.po, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
573         po/it.po, po/pl.po, po/sl.po, po/sv.po: Sync with translation project.
575         * src/buffer.c (new_volume): Stop if the script exits with an error.
577         * src/common.h (excluded_with_slash, excluded_without_slash):
578         Remove, replacing by:
579         (excluded): New decl.
580         (link_error): New decl.
581         (excluded_name): Now returns bool.
583         * src/extract.c:
584         (struct delayed_symlinks, extract_archive, apply_delayed_symlinks):
585         Support hard links to symbolic links.
587         (struct delayed_symlink): Remove 'names' member, replacing it with
588         'sources' and 'target' member.  All uses changed.
590         (struct string_list): New type.
592         (delayed_set_stat, extract_archive): Use offsetof when computing sizes
593         for struct hack; this avoids wasted space in some cases.
595         (extract_archive): Fix test for absolute pathnames and/or "..".
596         Use link_error to report errors for links.
597         Remove redundant trailing '/' at "really_dir", for all uses, not
598         just before invoking mkdir.
599         If overwriting old files, do not worry so much about existing
600         directories.
601         Fix mode computation in the case where the directory exists.
603         (apply_delayed_symlinks): If we can't make a hard link to a symbolic
604         link, make a copy of the symbolic link.
606         * src/incremen.c (get_directory_contents):
607         If ignore_failed_read_option, only warn about
608         stat failures.
610         * src/list.c (from_header): Do not issue a diagnostic if TYPE is zero.
611         However, check for error even for '-' or '+' case.
613         (print_header): Try parsing uids and gids as unsigned integers first,
614         and as a uid_t or gid_t only if that fails.  This adds support for
615         listing positive uids and gids that are greater than UID_MAX and
616         GID_MAX.
618         * src/misc.c (link_error): New function.
620         * src/names.c (collect_and_sort_names):
621         If ignore_failed_read_option, only warn about
622         stat errors.
624         (excluded_name): Now returns bool.  Simplify, as the fancy
625         features are now all in excluded_filename.
627         * src/rtapelib.c (base_name): Remove decl, as system.h now
628         declares it.
630         * src/system.h: Include stddef.h if available.
631         (offsetof): Declare if stddef.h doesn't.
633         Include <dirname.h>.
634         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now defined by dirname.h.
636         * src/tar.c (ANCHORED_OPTION, IGNORE_CASE_OPTION,
637         NO_ANCHORED_OPTION, NO_IGNORE_CASE_OPTION, NO_WILDCARDS_OPTION,
638         NO_WILDCARDS_MATCH_SLASH_OPTION, WILDCARDS_OPTION,
639         WILDCARDS_MATCH_SLASH_OPTION):
640         New enum values.
642         (long_options, usage, decode_options): Add support for --anchored,
643         --ignore-case, --no-anchored, --no-ignore-case, --no-wildcards,
644         --no-wildcards-match-slash, --recursion, --wildcards,
645         --wildcards-match-slash.
647         (decode_options): Implement the new way of interpreting exclude
648         patterns.
650         (usage): --newer-mtime takes a DATE operand.  DATE may be a file name.
652         (OPTION_STRING, decode_options): Add -I, -y.  Currently these options
653         just print error messages suggesting alternatives.
655         (add_filtered_exclude): Remove.
657         * tests/Makefile.am (TESTS): Alphabetize, except put version.sh first.
659         * tests/extrac04.sh (out): Remove
660         directory/subdirectory/file1, as the new semantics for
661         --exclude exclude it.
663         * tests/genfile.c (main): Don't use non-ASCII char in msgid.
665 2001-08-12  Paul Eggert  <eggert@twinsun.com>
667         * lib/addext.c (<errno.h>): Include.
668         (errno): Declare if not defined.
669         (addext): Work correctly on the Hurd, where pathconf returns -1 and
670         leaves errno alone, because there is no limit.  Also, work even if
671         size_t is narrower than long.
673 2001-07-08  Paul Eggert  <eggert@twinsun.com>
675         * lib/alloca.c (alloca): Arg is of type size_t, not unsigned.
677 2001-05-10  Paul Eggert  <eggert@twinsun.com>
679         * lib/addext.c (ISSLASH, base_name): Remove decls; now in dirname.h.
680         Include <backupfile.h> and <dirname.h> after size_t is defined.
681         (addext): Use base_len to trim redundant trailing slashes instead of
682         doing it ourselves.
684         * lib/backupfile.c (ISSLASH, base_name):
685         Remove decls; now in dirname.h.
686         Include <argmatch.h>, <backupfile.h>, <dirname.h> after size_t
687         is defined.
688         (find_backup_file_name): Rename locals to avoid new functions.
689         Use base_len instead of rolling it ourselves.
690         Work even if dirlen is 0.
691         Use a dir of '.' if given the empty string.
693         * lib/basename.c:
694         Do not include <stdio.h>, <assert.h>; no longer needed.
695         (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Remove; now in dirname.h.
696         Include <string.h>, <dirname.h>.
697         (base_name): Allow file names ending in slashes, other than names
698         that are all slashes.  In this case, return the basename followed
699         by the slashes.
701         * lib/dirname.c: Include <string.h> instead of <stdlib.h>.
702         (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove; now in dirname.h.
703         (dir_len): Renamed from dirlen.
704         All callers changed.
706         * lib/dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
707         New macros.
708         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
710 2001-02-16  Paul Eggert  <eggert@twinsun.com>
712         * lib/quotearg.c (mbrtowc, mbrtowc, mbsinit):
713         Do not declare or define if HAVE_MBRTOWC,
714         since the test for HAVE_MBRTOWC now requires proper declarations.
716         * lib/alloca.c (malloc): Undef before defining.
718 2001-02-13  Paul Eggert  <eggert@twinsun.com>
720         * src/compare.c (read_and_process): Use off_t for size.
721         From Maciej W. Rozycki.
723 2001-01-26  Paul Eggert  <eggert@twinsun.com>
725         * lib/quotearg.c: Include stddef.h.  From Jim Meyering.
727 2001-01-12  Paul Eggert  <eggert@twinsun.com>
729         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.19.
731         * lib/savedir.h (savedir): Remove size arg.
733         * doc/tar.texi: Add @setchapternewpage odd.
734         Remove -I as an alias for -T, for now.
735         Add @dircategory.
736         Update copyright.  Remove "Published by".
737         Dates beginning with / or . are taken to be file names.
739         * src/tar.c (<time.h>): Do not include;
740         (time): Do not declare.
741         (usage): Remove -I as an alias for -T.
742         (OPTION_STRING): Remove -I.
743         (decode_options): Dates that look like an absolute path name,
744         or that start with '.', are presumed to be file names whose
745         dates are taken.
746         Remove 'I' as an aliase for 'T'.
747         Update copyright.
749         * src/extract.c (<time.h>): Do not include; system.h now does this.
750         (make_directories): Skip filesystem prefixes.
751         Don't assume '/' is the only separator.
752         (extract_sparse_file): Use new full_write semantics.
753         On write error, return instead of invoking skip_file.
754         Do not free sparsearray; caller does this now.
755         (apply_nonancestor_delayed_set_stat): Do not assume '/' is the only
756         separator.
757         (extract_archive): Don't assume file name lengths fit in int.
758         Report what got stripped from member name; it might be more than '/'.
759         Use new full_write semantics.
760         Do not pass redundant trailing "/" to mkdir, as POSIX does not allow
761         mkdir to ignore it.
762         Do not report mkdir error if old_files_option == KEEP_OLD_FILES.
764         * src/buffer.c (<time.h>): Do not include; system.h now does this.
765         (time): Remove decl; likewise.
766         (child_open_for_uncompress): Use new full_write semantics.
767         (flush_write): Use ISSLASH instead of testing for '/'.
768         (flush_read): Likewise.
770         * src/rmt.h (_remdev): Look for / anywhere in Path.
772         * src/misc.c (contains_dot_dot): Skip filesystem prefix.
773         Don't assume '/' is the only separator.
774         (safer_rmdir): Don't assume '/' is the only separator.
776         * src/compare.c (diff_archive): Don't assume '/' is the only separator.
778         * lib/dirname.h (dirlen): New decl.
780         * src/incremen.c (get_directory_contents):
781         Remove path_size arg; all callers changed.
782         Don't assume '/' is the only directory separator.
783         (gnu_restore): Work even if file name length doesn't fit in int.
785         * lib/addext.c (ISSLASH): New macro.
786         (addext): Trim any redundant trailing slashes.
788         * src/names.c (name_next):
789         Don't assume '/' is the only directory separator.
790         (namelist_match): Likewise.
791         (add_hierarchy_to_namelist): Remove dirsize arg.
792         Do not assume '/' is the only directory separator.
793         (new_name): Likewise.
795         * lib/Makefile.am (noinst_HEADERS): Add dirname.h, full-write.h.
796         (libtar_a_SOURCES): Add dirname.c.
798         * src/create.c (relativize):
799         New function, with much of old start_header's guts.
800         Handle filesystem prefixes.
801         (start_header): Use this new function.
802         (init_sparsearray): Don't bother to zero out the new array;
803         it's not needed.
804         (deal_with_sparse): Fix array allocation bug.
805         (create_archive): Don't assume '/' is the only separator.
806         (dump_file): Likewise.
807         Don't worry about leading / in symlink targets.
809         * lib/savedir.c (savedir):
810         Remove size arg; it wasn't portable.  All callers changed.
812         * lib/utime.c (utime_null): Adjust to new full_write convention.
814         * configure.in (YACC): Avoid portability problem with Ultrix sh.
816         * lib/backupfile.c: Include <dirname.h>.
817         (ISSLASH): New macro.
818         (find_backup_file_name): Use dirlen to calculate directory lengths.
819         (max_backup_version): Strip redundant trailing slashes.
821         * src/common.h: Include <full-write.h>.
822         (get_directory_contents): No longer has size arg.
823         (gnu_restore): Arg is size_t, not int.
825         * src/system.h: Include <time.h>.
826         (time): Declare if not defined.
828         * lib/full-write.c: Include full-write.h, not safe-read.h.
829         full_write returns size_t, with short writes meaning failure.
830         All callers changed.
832         * src/rtapelib.c: Include full-write.h.
834         * src/rmt.c: Include full-write.h.
835         (main): Update copyright.
837         * doc/getdate.texi: Mention that only English is supported.
838         Show how to use "date" so that the output is acceptable to getdate.
839         Mention Z as an abbreviation for UTC.
841         * lib/full-write.h: New file.
843         * src/list.c: system.h now does time.h stuff.
845         * lib/dirname.c:
846         Use HAVE_STDLIB_H, not STDC_HEADERS, to decide whether to include
847         stdlib.h.
848         Do not include string.h, strings.h, or assert.h; no longer needed.
849         (strrchr, memrchr, malloc): Remove decls; no longer needed.
850         Include <xalloc.h>.
851         (base_name): New decl.
852         (BACKSLASH_IS_PATH_SEPARATOR): Remove.
853         (dir_name_r): Remove.
854         (dirlen): New function.
855         (dir_name): Use dirlen instead of dir_name_r.
856         (<string.h>, <strings.h>): Include only if test program.
857         (main): Use "return 0", not "exit (0)".
859 2000-12-08  Paul Eggert  <eggert@twinsun.com>
861         * lib/dirname.h: New file.
863 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
865         * lib/fnmatch.c: Do not comment out all the code if we are using
866         the GNU C library, because in some cases we are replacing buggy
867         code in the GNU C library itself.
869 2000-10-30  Paul Eggert  <eggert@twinsun.com>
871         * lib/fnmatch.c (FOLD): Do not assume that characters are unsigned.
873 2000-10-29  Paul Eggert  <eggert@twinsun.com>
875         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.18.
877         * src/tar.c: Include <fnmatch.h>, for FNM_LEADING_DIR.
879 2000-10-28  Paul Eggert  <eggert@twinsun.com>
881         * doc/tar.texi: --no-recursion now applies to extraction, too.
882         * src/create.c (dump_file): no_recurse_option -> ! recursion_option
883         * src/names.c (namelist_match, excluded_name):
884         Do not match subfiles of a directory
885         if --no-recursion is specified.
886         * src/tar.c (NO_RECURSE_OPTION): Remove.
887         (long_options): Have getopt set the --no-recursion flag.
888         (decode_options): Initialize recursion_option to FNM_LEADING_DIR.
889         Remove case for NO_RECURSE_OPTION.
890         * src/common.h (recursion_option):
891         Renamed from no_recurse_option, with sense
892         negated, and with FNM_LEADING_DIR being the nonzero value.
894         * names.c (namelist_match): New function.
895         (name_match, name_scan): Use it to eliminate duplicate code.
896         (names_notfound): Remove special case for Amiga.
898 2000-10-27  Paul Eggert  <eggert@twinsun.com>
900         * src/misc.c (read_error_details, read_warn_details,
901         read_fatal_details): Don't assume size_t is unsigned long.
903         * src/buffer.c (flush_read): If read_full_records_option, try to
904         fill the input buffer, as --delete -f - needs this.
906 2000-10-24  Paul Eggert  <eggert@twinsun.com>
908         * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Port to autoconf 2.13.
910         * src/buffer.c (check_label_pattern):
911         Make sure header name is a string before
912         passing it to fnmatch.
913         (init_volume_number): Check for global_volno overflow.
914         (new_volume): Check for global_volno overflow.
916         * src/tar.c (decode_options):
917         Check that volume label is not too long to overflow
918         name in tar header block.
920         * Makefile.am (EXTRA_DIST): Remove rebox.el.
922         * configure.in (HAVE_DECL_STRERROR_R): Remove our handwritten code.
923         (AC_FUNC_STRERROR_R): Use this instead.
925 2000-10-23  Paul Eggert  <eggert@twinsun.com>
927         * src/extract.c: Include <time.h>, since we invoke "time".
929         * lib/prepargs.c (prepend_default_options):
930         Don't use NULL, for portability.
932         * m4/fnmatch.m4: Add "working" to message.
934         * src/names.c: (_GNU_SOURCE): Remove; autoconf now does this.
935         Include <hash.h>.
936         (getpwuid, getgrgid): Declare only if system headers don't.
937         (gid_to_gname): Don't invoke setgrent.
938         (namelist): Now static, not global.
939         (nametail): New var.  All uses of namelast changed to use
940         nametail, with one extra level of indirection.
941         (name_gather): Use memcpy instead of strncpy + assignment of NUL.
942         (name_match): Set nametail too, when setting namelist to null.
943         (add_hierarchy_to_namelist): Change type of dir arg from char * to
944         struct name *, so that we don't have to look up the name again
945         here.  Get change_dir from dir rather than as a separate arg.  Add
946         dirsize arg, and pass it along to get_directory_contents.  Remove
947         unnecessary check of directory type.
948         (new_name): Do not append a slash if PATH already ends in one.
949         (avoided_names, struct avoided_name): Remove.
950         (avoided_name_table): New var, replacing avoided_names.
951         (hash_avoided_name, compare_avoided_names): New function.
952         (add_avoided_name, is_avoided_name): Use hash table rather than
953         linked list.
955         * src/buffer.c (_GNU_SOURCE): Remove; autoconf now does this.
956         (child_open_for_compress, child_open_for_uncompress,
957         close_archive): Propagate any failure of the compression process
958         back to "tar".
959         (open_archive, flush_write, flush_read, close_archive): Do not
960         allocate an array of size PATH_MAX, as PATH_MAX might be (size_t)
961         -1.  Instead, allocate an array with the size that's needed.
962         (open_archive): Don't bother checking S_ISCHR of /dev/null.
963         (backspace_output): Don't try to backspace past start of archive.
964         (close_archive): Remove special case for DELETE_SUBCOMMAND.
966         * acconfig.h (_GNU_SOURCE, DEFAULT_ARCHIVE, DEFAULT_BLOCKING,
967         DENSITY_LETTER, DEVICE_PREFIX, EMUL_OPEN3, HAVE_GETGRGID,
968         HAVE_GETPWUID, HAVE_MKNOD, HAVE_RTAPELIB, HAVE_ST_FSTYPE_STRING,
969         HAVE_UNION_WAIT, HAVE_UTIME_H, HAVE_VALLOC, MTIO_CHECK_FIELD, PACKAGE,
970         PROTOTYPES, REMOTE_SHELL, STD_INC_PATH, VERSION, WITH_CATALOGS,
971         WITH_DMALLOC, WITH_REGEX):
972         Remove; now generated automatically.
974         * configure.in (_GNU_SOURCE): Define to empty, not 1, for
975         compatibility for glibc fragments.
976         (_GNU_SOURCE, HAVE_UTIME_H, MTIO_CHECK_FIELD,
977         HAVE_ST_FSTYPE_STRING, HAVE_MKNOD, REMOTE_SHELL, DENSITY_LETTER,
978         DEVICE_PREFIX, DEFAULT_ARCHIVE, DEFAULT_BLOCKING): Add comment so
979         that we needn't put an entry into acconfig.h.
980         (ALL_LINGUAS): Add da.
981         (AC_C_BACKSLASH_A): Remove; jm_PREREQ_QUOTEARG now does this.
982         (AC_CHECK_HEADERS): Add stdbool.h (for hash.h users), wctype.h
983         (for strtol.c).
984         (AC_MBSTATE_T): Add.
985         (RMT): Append $(EXEEXT).
986         (HAVE_GETGRGID, HAVE_GETPWUID, pe_AC_TYPE_SIGNED_CHAR): Remove.
987         (HAVE_DECL_FREE, HAVE_DECL_GETGRGID, HAVE_DECL_GETPWUID,
988         HAVE_DECL_GETENV, HAVE_DECL_MALLOC, HAVE_DECL_STRTOUL,
989         HAVE_DECL_STRTOULL, HAVE_DECL_STRERROR_R): New macros.
990         (jm_PREREQ_ADDEXT, jm_PREREQ_ERROR, jm_PREREQ_QUOTEARG): Add.
991         (AC_REPLACE_FUNCS): Remove execlp; no longer needed.
992         (AC_CHECK_FUNCS): Add clock_gettime; AC_SEARCH_LIBS wasn't enough.
993         Remove mbrtowc; jm_PREREQ_QUOTEARG now does this.
994         (EMUL_OPEN3): Remove; no longer needed.
995         (DENSITY_LETTER, DEVICE_PREFIX): Simplify m4 quoting.
997         * m4/fnmatch.m4 (AC_FUNC_FNMATCH): Detect d*/*1 vs d/s/1 bug.
999         * src/common.h: Do not include basename.h.
1000         * src/rtapelib.c (base_name): Do not include basename.h;
1001         declare base_name instead.
1003         * lib/basename.h, lib/execlp.c, lib/getpagesize.h, lib/mkdir.c:
1004         Remove these files.
1005         * lib/getstr.c, lib/getstr.h, lib/hash.h, lib/hash.h, lib/prepargs.c,
1006         lib/prepargs.h, lib/savedir.c, lib/savedir.h: New files.
1007         * lib/Makefile.am (EXTRA_DIST, noinst_HEADERS, libtar_a_SOURCES):
1008         Adjust to the above changes.
1010         * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove ../src/ansi2knr.
1012         * src/open3.c: Remove.
1014         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
1015         (tar_SOURCES): Remove open3.c.
1016         (INCLUDES): Remove -I.., as automake does that.
1017         (OMIT_DEPENDENCIES): ../lib/fnmatch.h -> fnmatch.h.  Add localedir.h.
1019         The following changes are to put LOCALEDIR into localedir.h instead
1020         of passing it on the command line.
1021         (DEFS): Remove.
1022         (DISTCLEANFILES): New macro.
1023         (localedir.h): New rule.
1024         (rmt.o tar.o): Now depend on localedir.h.
1026         * tests/delete02.sh, tests/extrac04.sh: New files.
1028         * tests/Makefile.am (AUTOMAKE_OPTIONS): Remove ansi2knr.
1029         (TESTS): Add extrac04.sh, and restore delete02.sh.
1030         (DEFS): Remove; LOCALEDIR is now done via localedir.h.
1031         (INCLUDES): Remove -I.. as automake does this now.
1033         * src/rtapelib.c (rexec): Don't declare unless using it.
1034         (do_command): Simplify signal-handling code slightly.
1036         * src/delete.c (blocks_needed): Remove.  All uses changed to use
1037         blocking_factor - new_blocks.
1038         (acting_as_filter): New var.
1039         (write_record, delete_archive_members): Use acting_as_filter
1040         rather than archive == STDIN_FILENO to detect whether we're acting
1041         as a filter, as open can return STDIN_FILENO in some cases.
1042         (delete_archive_members): Ignore zero blocks if
1043         ignore_zeros_option is nonzero.  Fix bug that messed up last
1044         output block: write_eot can't be used here, as it gets confused
1045         when the input is at end of file.
1047         * src/compare.c (diff_archive): Do not impose an arbitrary limit on
1048         symbolic link contents length.  Pass directory size to
1049         get_directory_contents.
1051         * m4/decl.m4, m4/error.m4, m4/mbstate_t.m4, m4/prereq.m4,
1052         m4/strerror_r.m4: New files.
1053         * m4/signedchar.m4: Remove this file.
1054         * Makefile.am (ACINCLUDE_INPUTS): Adjust to above changes.
1055         * m4/Makefile.am (EXTRA_DIST): Likewise.
1057         * Makefile.am (DISTCLEANFILES): Add intl/libintl.h.
1059         * po/da.po: New translation file.
1061         * src/mangle.c (extract_mangle):
1062         Fix diagnostic with wrong number of %s'es.
1064         * lib/fnmatch.c (fnmatch):
1065         Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
1066         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
1068         * lib/full-write.c (full_write): Some buggy drivers return 0 when you
1069         fall off a device's end.  Detect this.
1071         * src/system.h (IN_CTYPE_DOMAIN): Renamed from CTYPE_DOMAIN.  All
1072         uses changed.
1073         (open): Remove macro; we no longer support EMUL_OPEN3.  Do not
1074         include <pathmax.h> and directory include files like <dirent.h>;
1075         no longer used.  Include <savedir.h> instead.
1076         (closedir, signed_char): remove macro; no longer used.
1077         (bool, false, true): Include <stdbool.h> if you have the include
1078         file, otherwise define.
1080         * src/misc.c:
1081         (is_dot_or_dotdot, closedir_error, closedir_warn, opendir_error,
1082         opendir_warn, readdir_error): Remove; no longer needed.
1083         (safer_rmdir): Strip leading ./ (or .// or ./// or ././ or etc.)
1084         before deciding whether we're trying to remove ".".
1085         (remove_any_file): Try unlink first if we are not root.  Use
1086         savedir when recursively removing directories, to avoid exhausting
1087         file descriptors.
1088         (savedir_error, savedir_warn, symlink_error): New functions.
1090         * src/list.c: (read_and): Do not invoke
1091         apply_nonancestor_delayed_set_stat; DO_SOMETHING is now
1092         responsible for that.  Do not invoke apply_delayed_set_stat; our
1093         caller is now responsible for that.
1094         (read_header): Use signed char instead of signed_char.  Prevent
1095         later references to current_header from mistakenly treating it as
1096         an old GNU header.
1097         (from_header): Quote invalid base-64 strings in diagnostics.
1098         (time_from_header): Do not warn about future timestamps in
1099         archive; check_time now does that.
1100         (print_header): Quote unknown file types.
1101         (skip_member): New function, replacing skip_extended_headers and
1102         now skipping the whole member instead of just the extended
1103         headers.  All callers changed.  This makes the code handle
1104         extended headers uniformly, and fixes some bugs.
1106         * src/update.c (update_archive): Use skip_member.
1108         * src/extract.c (we_are_root): Now global.
1109         (struct delayed_symlink): New type.
1110         (delayed_symlink_head): New var.
1111         (extr_init, fatal_exit): Invoke extract_finish on fatal errors,
1112         not apply_delayed_set_stat.
1113         (set_mode, set_stat): Pointer args are now const pointers.
1114         (check_time): New function.
1115         (set_stat): Warn if setting a file's timestamp to be the future.
1116         (make_directories): Do not save and restore errno.
1117         (maybe_recoverable): Set errno to ENOENT if we cannot make missing
1118         intermediate directories.
1119         (extract_archive): Invoke apply_nonancestor_delayed_set_stat here,
1120         not in caller.  Extract potentially dangerous symbolic links more
1121         carefully, deferring their creation until the end, and using a
1122         regular file placeholder in the meantime.  Do not remove trailing
1123         / and /. from file names.  Do not bother checking for ".." when
1124         checking whether a directory loops back on itself, as loopbacks
1125         can occur with symlinks too.  Also, in that case, do not bother
1126         saving and restoring errno; just set it to EEXIST.
1127         (apply_nonancestor_delayed_set_stat): A prefix is a potential
1128         ancestor if it ends in slash too (as well as ending in a char just
1129         before slash).
1130         (apply_delayed_set_stat): Remove.
1131         (apply_delayed_symlinks, extract_finish): New functions.
1133         * doc/fdl.texi: New file.
1134         * doc/Makefile.am (EXTRA_DIST): Add fdl.texi.
1135         ($(srcdir)/tar.info): Add fdl.texi.  Invoke makeinfo with --no-split.
1136         * doc/tar.texi: Add Free Documentation License.  New section
1137         "Overwrite Old Files", and revamp that section to make it easier to
1138         follow.  "tar" -> "GNU tar" where appropriate.  Migrate getdate
1139         documentation into getdate.texi.  Fix several minor typos.  Describe
1140         TAR_OPTIONS.  Describe incompatibility between incremental backups and
1141         --atime-preserve.  Describe incompatibility between --verify and other
1142         options.  Mention that tar normally removes symbolic links rather than
1143         following them, when extracting a file of the same name.
1145         * THANKS: Add gpoul.  Change skip's address.
1147         * po/POTFILES.in: Add lib/human.c.
1149         * src/common.h (namelist, namelast): Remove decls.
1150         (we_are_root, extract_finish, skip_member, savedir_error,
1151         savedir_warn, symlink_error, gnu_list_name): New decls.
1152         (apply_delayed_set_stat, apply_nonancestor_delayed_set_stat,
1153         skip_extended_headers, is_dot_or_dotdot, closedir_error,
1154         closedir_warn, opendir_error, opendir_warn, readdir_error,
1155         readdir_warn): Remove decls.
1156         (get_directory_contents): New off_t arg.
1157         (addname): Now returns struct name *.
1159         * src/tar.h, tests/genfile.c: Fix comments.
1161         * src/create.c: Include hash.h.
1162         (gnu_list_name): Remove decl.
1163         (struct link): Remove "next" member.
1164         (linklist): Remove.
1165         (start_header): Say "leading `FOO'" rather than "`FOO' prefix" for
1166         consistency with other diagnostics.
1167         (deal_with_sparse): Check for I/O error when closing the file.
1168         (create_archive): Do not allocate an array of size PATH_MAX, as
1169         PATH_MAX might be (size_t) -1.  Instead, allocate an array with
1170         the size that's needed.
1171         (hash_link, compare_links): New functions.
1172         (dump_file): Do not exhaust open file descriptors when descending
1173         deeply into a directory, by using savedir rather than
1174         opendir/readdir.  Do not zero-fill the name buffer unnecessarily.
1175         Hash the set of links already created, instead of using a linked
1176         list.  Fix some bugs in outputting sparse files which caused the
1177         sparse tables to be incorrect.  When a file unexpectedly shrinks,
1178         output zeros rather than garbage.  Do not allocate an array of
1179         size PATH_MAX, as PATH_MAX might be (size_t) -1.  Instead,
1180         allocate an array with the size that's needed.
1182         * src/incremen.c: Include hash.h.
1183         (struct directory): Remove "next", "dir_text".  Change "name" to
1184         be char[1] with struct hack, not const char *.  Add "found".
1185         (directory_list): Remove.  Replaced by directory_table.
1186         (directory_table): New var.
1187         (nfs_string): Renamed from nfs.
1188         (hash_directory, compare_directories): New functions.
1189         (note_directory): Now returns struct directory *.  First arg is
1190         now const pointer.  struct stat arg is now dev_t, ino_t, nfs.
1191         Remove text arg.  New "found" arg, basically corresponding to the
1192         old text arg not being null.  All callers changed.
1193         (note_directory, find_directory): Use hash table rather than
1194         linked list.
1195         (get_directory_contents): New arg "device".  Use savedir to do the
1196         hard work.  Save the nfs-ness of stat_data, since it might change
1197         under us.  Use note_directory instead of find_directory to save
1198         some work.  When adding an "A" record, do it with
1199         add_to_accumulator instead of cheating with strcat.
1200         (read_directory_file): Use "+" flag before device to indicate
1201         whether it was NFS.  Fix typo in checking for strtoul error.
1202         (write_directory_file_entry): New function.
1203         (write_directory_file): Use it, and use the hash routines to
1204         traverse the directory table.
1205         (gnu_restore): Use savedir rather than opendir/readdir.
1207         * src/tar.c: Include localedir.h, prepargs.h.
1208         (long_options): Now static.
1209         (long_options, usage, decode_options): -j is now short for
1210         --bzip2, and -I is now an alias for -T.
1211         (decode_options, main): argv is not const pointer now.
1212         (decode_options): Invoke prepend_default_options to support
1213         TAR_OPTIONS.  In diagnostic, mention the string that was the
1214         invalid blocking factor, tape length, group, owner, or record
1215         size.  --delete is no longer incompatible with -f -, undoing
1216         2000-01-07 change.
1217         (main): Invoke extract_finish at end of extraction.
1219         * src/rmt.c: Include localedir.h.
1220         (main): Update copyright date to 2000.
1222         * doc/getdate.texi: New file, taken from fileutils 4.0.27, with the
1223         following changes: Use @sc where appropriate.  Document the ranges of
1224         supported times more precisely.  Add Eggert to getdate authors.
1225         Document old Latin 12m/12pm tradition.  Remove list of alphabetic time
1226         zone names, as it wasn't correct and people shouldn't be relying on it
1227         anyway.  Relative items also account for non-DST adjustments.  Fix
1228         some misspellings.
1230         * lib/prepargs.c, lib/prepargs.h, tests/extrac04.sh: New file.
1232         * tests/ignfail.sh: opendir -> savedir in diagnostics.
1234         * tests/preset.in: Set LANGUAGE to the empty string, for some
1235         brain damaged host.
1237 2000-10-20  Paul Eggert  <eggert@twinsun.com>
1239         * m4/fnmatch.m4: Mention the GNU C library.
1241 2000-10-19  Paul Eggert  <eggert@twinsun.com>
1243         * m4/fnmatch.m4: Add a couple more test cases to catch bugs in
1244         glibc 2.1.95.
1246 2000-10-17  Paul Eggert  <eggert@twinsun.com>
1248         * lib/human.c (<limits.h>): Do not include; human.h does it if needed.
1249         (CHAR_BIT): Remove.
1251         * lib/human.h (<limits.h>): Include if HAVE_LIMITS_H.
1252         (CHAR_BIT): Define if not defined.
1254 2000-09-09  Paul Eggert  <eggert@twinsun.com>
1256         * lib/quotearg.c: From fileutils: rename ISASCII to IN_CTYPE_DOMAIN.
1258 2000-08-07  Paul Eggert  <eggert@twinsun.com>
1260         * lib/xmalloc.c: Memory exhausted -> memory exhausted
1262         * lib/xalloc.h (xalloc_msg_memory_exhausted):
1263         change to array from char *.
1265 2000-08-06  Paul Eggert  <eggert@twinsun.com>
1267         * m4/mbstate_t.m4: Define mbstate_t to be int, not char, for
1268         compatibility with glibc 2.1.3 strftime.c.
1270 2000-07-31  Paul Eggert  <eggert@twinsun.com>
1272         * lib/quotearg.c (quotearg_n_options):
1273         Don't make the initial slot vector a constant,
1274         since it might get modified.
1276         * lib/quotearg.c: Add support for more than one preallocated slot.
1278 2000-07-30  Paul Eggert  <eggert@twinsun.com>
1280         * lib/quotearg.c (quotearg_n_options):
1281         Preallocate a slot 0 buffer, so that the caller
1282         can always quote one small component of a "memory exhausted" message
1283         in slot 0.
1285 2000-07-23  Paul Eggert  <eggert@twinsun.com>
1287         * lib/quotearg.c:
1288         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX), so that
1289         mbstate_t is always defined.
1291         Do not inspect MB_LEN_MAX, since it's incorrectly defined to be 1 in
1292         some GCC installations, and this configuration error is likely to be
1293         common.
1295 2000-07-22  Paul Eggert  <eggert@twinsun.com>
1297         * lib/quotearg.c:
1298         When the system forces us to redefine mbstate_t, shadow its mbsinit
1299         function.  From Bruno Haible.
1301 2000-07-14  Paul Eggert  <eggert@twinsun.com>
1303         * lib/xmalloc.c: Simplify exhausted message.
1305         * lib/quotearg.h: Update copyright date; from Jim Meyering.
1307 2000-07-13  Paul Eggert  <eggert@twinsun.com>
1309         * lib/quotearg.h (enum quoting style):
1310         New constant clocale_quoting_style.
1312         * lib/quotearg.c:
1313         (quoting_style_args, quoting_style_vals, quotearg_buffer_restyled):
1314         Add support for clocale_quoting_style, undoing previous change to
1315         locale_quoting_style.
1317 2000-07-10  Paul Eggert  <eggert@twinsun.com>
1319         * lib/quotearg.c:
1320         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX,
1321         since otherwise we don't need it.
1322         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
1323         since we don't do multibytes in that case.
1324         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
1325         invoke multibyte primitives.
1327         * m4/mbstate_t.m4 (AC_MBSTATE_T):
1328         Renamed from AC_MBSTATE_T_OBJECT.  All uses changed.
1329         Change from a two-part test, which defines both HAVE_MBSTATE_T_OBJECT
1330         and mbstate_t, to a single-part test that simply defines mbstate_t.
1332         * lib/quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
1333         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
1334         to decide whether to define the BeOS workaround macro;
1335         this adjusts to the change to AC_MBSTATE_T.
1337         * m4/strerror_r.m4: New file.
1339 2000-07-05  Paul Eggert  <eggert@twinsun.com>
1341         * lib/quotearg.c: Use double-quote to quote.
1343         * lib/quotearg.c (N_): New macro.
1344         (gettext_default): New function.
1345         (quotearg_buffer_restyled): Use gettext_default ("{LEFT QUOTATION MARK}",
1346         "\"") for left quote, and gettext_default ("{RIGHT QUOTATION MARK}", "\"")
1347         for right quote.
1349         * lib/quotearg.c (struct quoting_options):
1350         Simplify quote_these_too dimension.
1351         From Bruno Haible  <haible@clisp.cons.org>.
1353         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT):
1354         Test for mbstate_t only if the test
1355         for an object-type mbstate_t fails.
1357         * lib/quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
1359 2000-07-03  Paul Eggert  <eggert@twinsun.com>
1361         * m4/mbstate_t.m4 (AC_MBSTATE_T_OBJECT): Port to autoconf 2.13.
1362         Add AC_CHECK_HEADERS(stdlib.h), since we use HAVE_STDLIB_H.
1364         * lib/quotearg.c (mbrtowc):
1365         Assign to *pwc, and return 1 only if result is nonzero.
1366         (iswprint): Define to ISPRINT if we are substituting our own mbrtowc.
1368 2000-07-02  Paul Eggert  <eggert@twinsun.com>
1370         * lib/quotearg.c (mbstate_t):
1371         Do not define; it should be defined with AC_CHECK_TYPE.
1373 2000-06-26  Paul Eggert  <eggert@twinsun.com>
1375         * m4/mbstate_t.m4: Include stdio.h before wchar.h, to work around
1376         a bug in glibc 2.1.3.
1378         * lib/xmalloc.c: Fix inaccorate comment for xrealloc.
1380 2000-06-19  Paul Eggert  <eggert@twinsun.com>
1382         * lib/quotearg.c (ISASCII): Add #undef and move definition to follow
1383         inclusion of wctype.h to work around solaris2.6 namespace pollution.
1384         (ISPRINT): Likewise.
1385         Reported by Tom Tromey.
1387 2000-06-15  Paul Eggert  <eggert@twinsun.com>
1389         * lib/human.c (adjust_value): New function.
1390         (human_readable_inexact): Apply rounding style even when printing
1391         approximate values.
1393         * lib/human.c: Avoid shadowing warnings.
1394         From Jim Meyering.
1396 2000-06-14  Paul Eggert  <eggert@twinsun.com>
1398         * lib/human.c (human_readable_inexact): Allow an input block size
1399         that is not a multiple of the output block size, and vice versa.
1401         * lib/getdate.y (get_date): Apply relative times after time zone
1402         indicator, not before.
1404 2000-05-31  Paul Eggert  <eggert@twinsun.com>
1406         * m4/largefile.m4: Rewrite so that we don't need to run getconf,
1407         and thus don't need AC_CANONICAL_HOST.
1409         (AC_SYS_LARGEFILE_FLAGS, AC_SYS_LARGEFILE_SPACE_APPEND): Remove.
1410         (AC_SYS_LARGEFILE_TEST_INCLUDES): New macro.
1411         (AC_SYS_LARGEFILE_MACRO_VALUE): Change arguments from
1412         CODE-TO-SET-DEFAULT to VALUE, INCLUDES, FUNCTION-BODY.  All uses
1413         changed.  Instead of inspecting the output of getconf, try to
1414         compile the test program without and with the macro definition.
1415         (AC_SYS_LARGEFILE): Do not require AC_CANONICAL_HOST or check for
1416         getconf.  Instead, check for the needed flags by compiling test
1417         programs.
1419         * configure.in (AC_CANONICAL_HOST): Remove; the largefile stuff no
1420         longer needs it.
1421         * config.guess, config.sub: Remove these files, for similar reasons.
1423 2000-05-03  Paul Eggert  <eggert@twinsun.com>
1425         * m4/largefile.m4 (AC_SYS_LARGEFILE): Define _XOPEN_SOURCE to be
1426         500, instead of _GNU_SOURCE to be 1, to work around glibc 2.1.3
1427         bug.  This avoids a clash when files like regex.c that define
1428         _GNU_SOURCE.
1430 2000-05-02  Paul Eggert  <eggert@twinsun.com>
1432         * m4/largefile.m4 (AC_SYS_LARGEFILE):
1433         Define _GNU_SOURCE if this is needed to make
1434         ftello visible (e.g. glibc 2.1.3).  Use compile-time test, rather than
1435         inspecting host and OS, to decide whether to define _LARGEFILE_SOURCE.
1437         * lib/quotearg.c (mbrtowc, mbstat_t):
1438         Add definitions if !HAVE_MBSTATE_T_OBJECT.
1439         (<wctype.h>): Include if HAVE_WCTYPE_H.
1440         (iswprint): Define to 1 if we lack it
1442 2000-04-18  Paul Eggert  <eggert@twinsun.com>
1444         * m4/mbstate_t.m4: New file.
1446 2000-04-17  Bruno Haible  <haible@clisp.cons.org>
1448         * tests/ignfail.sh: Test for uid 0 along with user "root".
1450 2000-04-05  Paul Eggert  <eggert@twinsun.com>
1452         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS):
1453         Don't use -n32 on IRIX if the installer said
1454         otherwise.
1456 2000-02-28  Paul Eggert  <eggert@twinsun.com>
1458         * lib/quotearg.c (ALERT_CHAR): New macro.
1459         (quotearg_buffer_restyled): Use it.
1461 2000-02-23  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
1463         * src/list.c (tartime): Fix off-by-one error when copying year if
1464         OLD_CTIME.
1466 2000-02-18  Paul Eggert  <eggert@twinsun.com>
1468         * lib/getdate.y: Handle two-digit years with leading zeros correctly.
1469         (textint): New typedef.
1470         (parser_control): Changed from struct parser_control to typedef
1471         (for consistency).  Member year changed from int to textint.  All
1472         uses changed.
1473         (YYSTYPE): Removed; replaced by %union with int and textint
1474         members.
1475         (tID): Removed; not used.
1476         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE,
1477         tMERIDIAN, tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER,
1478         tUNUMBER, tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
1479         (tSNUMBER, tUNUMBER): Now of type <textintval>.
1480         (date, number, to_year): Use width of number in digits, not its
1481         value, to determine whether it's a 2-digit year, or a 2-digit
1482         time.
1483         (yylex): Store number of digits of numeric tokens.  Return '?' for
1484         unknown identifiers, rather than (unused) tID.
1486 2000-01-16  Paul Eggert  <eggert@twinsun.com>
1488         * lib/quotearg.c (quotearg_buffer_restyled):
1489         Do not quote alert, backslash, formfeed,
1490         and vertical tab unnecessarily in shell quoting style.
1492 2000-01-15  Paul Eggert  <eggert@twinsun.com>
1494         * m4/c-bs-a.m4:
1495         Change quoting to be compatible with future autoconf versions.
1497 2000-01-11  Paul Eggert  <eggert@twinsun.com>
1499         * lib/exclude.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Remove unused macros.
1501 2000-01-07  Paul Eggert  <eggert@twinsun.com>
1503         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.17.
1505         Fix bug with fnmatch.h dependency, as follows:
1506         * src/Makefile.am (OMIT_DEPENDENCIES): New macro.
1507         * lib/Makefile.am (OMIT_DEPENDENCIES): New macro.
1509         * src/common.h (apply_nonancestor_delayed_set_stat):
1510         Renamed from apply_delayed_set_stat.
1511         (apply_delayed_set_stat, decode_mode, chmod_error_details,
1512         chown_error_details, close_warn, closedir_warn, mkdir_error,
1513         read_error_details, read_fatal_details, read_warn_details,
1514         seek_error_details, seek_warn_details, utime_error,
1515         write_error_details, write_fatal_details): New decls.
1517         Make diagnostic messages more regular.
1518         * src/create.c (dump_file): Quote file names with colons if possible.
1519         * src/compare.c (diff_archive): Likewise.
1520         * src/extract.c (repair_delayed_set_stat, extract_archive): Likewise.
1521         * src/incremen.c (get_directory_contents, gnu_restore): Likewise.
1522         * src/mangle.c (extract_mangle): Likewise.
1523         * src/misc.c (call_arg_error, call_arg_fatal, call_arg_warn):
1524         Likewise.
1525         * src/buffer.c (archive_write_error, flush_archive, close_archive,
1526         new_volume, xclose):
1527         Use error message functions to report errors consistently.
1528         * src/compare.c (diff_sparse_files, diff_archive): Likewise.
1529         * src/create.c (finish_sparse_file, dump_file): Likewise.
1530         * src/extract.c (set_mode, set_stat, extract_sparse_file,
1531         extract_archive): Likewise.
1532         * src/list.c (list_archive): Likewise.
1533         * src/update.c (append_file): Likewise.
1534         * src/compare.c (diff_init, diff_sparse_files):
1535         Use xalloc_die to report memory exhaustion.
1536         * src/incremen.c (gnu_restore): Likewise.
1537         * src/list.c (read_header): Likewise.
1538         * src/mangle.c (extract_mangle): Likewise.
1539         * src/misc.c (maybe_backup_file): Likewise.
1540         * src/tar.c (decode_options): Likewise.
1541         * src/compare.c (read_and_process, fill_in_sparse_array,
1542         diff_sparse_files):
1543         Use consistent terminology for unexpected-EOF message.
1544         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
1545         * src/list.c (list_archive, read_header, skip_file,
1546         skip_extended_headers): Likewise.
1547         * src/buffer.c (archive_write_error): Add noreturn attribute to decl.
1548         (xdup2): Regularize messages with rest of tar.
1550         * src/buffer.c (flush_read): Don't read past EOF.
1552         * src/extract.c (extr_init):
1553         If we run out of memory, invoke apply_delayed_set_stat.
1554         (prepare_to_extract): Don't complain if we can't remove ".".
1555         (apply_delayed_set_stat): New function.
1556         (apply_nonancestor_delayed_set_stat):
1557         Renamed from apply_delayed_set_stat.  All uses changed.
1558         Don't remove head if it doesn't apply.
1560         * src/create.c (find_new_file_size):
1561         Return size instead of storing through pointer.
1562         All callers changed.
1563         (deal_with_sparse): Don't keep reading after read errors.
1564         (finish_sparse_file): Just abort if there is an internal error.
1565         (dump_file): Fix typo: stat_warn and stat_error were interchanged.
1566         Don't restore access times on directories during incremental dumps
1567         until after dealing with the directory.
1568         If ignoring failed reads, count closedir, read, and unknown
1569         file errors as warnings, not errors.
1570         Fix buffer overrun problem when dumping sparse files.
1572         * src/list.c (read_and):
1573         Invoke apply_nonancestor_delayed_set_stat on file names
1574         after handling them.
1575         (decode_mode): Remove; moved to misc.c.
1577         * src/misc.c (safer_rmdir): New function.
1578         (remove_any_file): Use it to avoid problems with rmdir(".").
1579         (maybe_backup_file): Regularize diagnostics.
1580         (undo_backup_file): Likewise.
1581         (decode_mode): Moved here from list.c.
1582         (chmod_error_details, chown_error_details, close_fatal,
1583         close_warn, closedir_warn, mkdir_error, read_error_details,
1584         read_warn_details, read_fatal_details, seek_error_details,
1585         seek_warn_details, utime_error, write_error_details,
1586         write_fatal_details): New functions.
1588         * src/delete.c (save_record): Remove static variable (now local).
1589         (move_archive): Don't position before start of archive.
1590         (write_record): Abort if count is zero at inopportune time.
1591         Plug memory leak.
1593         * src/tar.c (decode_options): --delete and -f - are now
1594         incompatible, since we didn't have time to fix their bugs.
1596         * tests/Makefile.am (TESTS): Remove delete02.sh.
1597         * tests/ignfail.sh: Adjust to new quoting scheme again.
1599 2000-01-06  Paul Eggert  <eggert@twinsun.com>
1601         * lib/getdate.y: Sync tm_diff with the GNU C Library.
1602         (TM_YEAR_BASE): Renamed from TM_YEAR_ORIGIN.  All uses changed.
1603         (tm_diff): Renamed from difftm.  All uses changed.
1604         Replace body with that taken from GNU C Library 2.1.3pre1.
1605         (get_date): Prefer tm_gmtoff to tm_diff if available.
1607 1999-12-29  "Melissa O'Neill"  <oneill@cs.sfu.ca>
1609         * tests/incremen.sh: Invoke stat on newly created file so that its
1610         ctime is updated on Nextstep.
1612 1999-12-21  Machael Stone  <mstone@cs.loyola.edu>
1614         * lib/getdate.y (get_date):
1615         Fix typo when checking for time_t overflow in time zone calculations.
1617 1999-12-13  Paul Eggert  <eggert@twinsun.com>
1619         * NEWS, configure.in (AC_INIT_AUTOMAKE): Version 1.13.16.
1621         * README-alpha: New file.
1622         * README: New sections for gzip and bzip2, Solaris.
1623         Remove mention of BACKLOG.
1625         * configure.in (AC_C_BACKSLASH_A): Add.
1626         (AC_CHECK_HEADERS): Add wchar.h.
1627         (AC_CHECK_FUNCS): Add mbrtowc.
1628         (AC_FUNC_CLOSEDIR_VOID): Add.
1630         * tests/Makefile.am (TESTS): Add delete02.sh.
1631         (POSTPONED_TESTS): Remove.
1632         (EXTRA_DIST): Remove $(POSTPONED_TESTS).
1634         * tests/preset.in:
1635         Set LC_ALL rather than LANGUAGE, LANG, and LC_MESSAGES.
1637         * tests/ignfail.sh (err): Adjust to new quoting scheme.
1639         * tests/delete02.sh: Fix typo: need to list archive2, not archive.
1641         * tests/extrac03.sh: Use -P option, so that .. doesn't get diagnosed.
1643         * src/tar.c ("quotearg.h"): New include.
1644         (usage): Now has __attribute__ ((noreturn)).
1645         (confirm): Report errno if we can't open tty.
1646         (confirm, decode_options):
1647         Quote arbitrary strings in diagnostics.
1648         (OVERWRITE_OPTION): New constant.
1649         (long_options, usage, decode_options): New --overwrite option.
1650         (decode_options): --keep-old-files, --overwrite, and --unlink-first
1651         are now mutually exclusive.
1652         Don't assume that gettext preserves errno.
1653         (main): Set default quoting style to escape_quoting_style.
1655         * src/update.c (<quotearg.h>): New include.
1656         (append_file):
1657         Don't assume that gettext preserves errno.
1658         Quote arbitrary strings in diagnostics.
1659         Check for close error.
1661         * src/names.c (<quotearg.h>): New include.
1662         (name_init, name_next, name_close, names_notfound,
1663         collect_and_sort_names): Don't assume that gettext preserves
1664         errno.  Quote arbitrary strings in diagnostics.
1665         (excluded_name): Fix typo that caused empty patterns to be
1666         mishandled.
1668         * src/misc.c (<quotearg.h>): New include.
1669         (quote_copy_string): Quote only newline and backslash; the output is no
1670         longer meant for humans, and is locale-independent.
1671         (contains_dot_dot): New function.
1672         (remove_any_file): Don't use lstat; just rmdir the file and then use
1673         unlink if the rmdir fails because the file isn't a directory.
1674         Check for readdir and closedir errors.
1675         (maybe_backup_file): Report "stat" for stat errors.
1676         (maybe_backup_file, chdir_do):
1677         Quote arbitrary strings in diagnostics.
1678         (maybe_backup_file, undo_last_backup):
1679         Don't assume that gettext preserves errno.
1680         (call_arg_error, call_arg_fatal, call_arg_warn,
1681         chdir_fatal, close_error, closedir_error, exec_fatal, mkfifo_error,
1682         mknod_error, open_error, open_fatal, open_warn, opendir_error,
1683         opendir_warn, read_error, read_fatal, readdir_error, readdir_warn,
1684         readlink_error, readlink_warn, seek_error, seek_warn, stat_error,
1685         stat_warn, truncate_error, truncate_warn, unlink_error, waitpid_error,
1686         write_error, write_fatal, xfork, xpipe, quote_n, quote): New functions.
1688         * src/system.h (__attribute__): New macro.
1689         (O_NDELAY, O_NONBLOCK, O_APPEND): Remove.
1690         (S_ISDOOR): New macro.
1691         (closedir): New macro, if CLOSEDIR_VOID.
1693         * src/rmt.c, src/rtapelib.c (decode_oflag):
1694         O_APPEND might not be defined.
1696         * src/list.c: (read_and, list_archive):
1697         Quote arbitrary strings in diagnostics.
1698         (from_header): Use locale_quoting_style to quote diagnostics.
1699         (print_header, print_for_mkdir): Quote with quotearg, not quote_copy_string.
1701         * src/rmt.h (REM_BIAS): Increase from 128 to (1 << 30).
1703         * src/Makefile.am: Use ## for copyright comments.
1705         * src/extract.c (<quotearg.h>): New include.
1706         (enum permstatus): New enum.
1707         (struct delayed_set_stat): file_name is now at end of buffer, to avoid
1708         two mallocs.  New members file_name_len, invert_permissions, permstatus.
1709         (extr_init): Remove hack that silently adjusted newdir_umask.
1710         (set_mode, set_stat): New args invert_permissions, permstatus, typeflag.
1711         Use these args to decide whether and how to set modes.
1712         (set_mode, set_stat, prepare_to_extract, extract_sparse_file, extract_archive):
1713         Don't assume that gettext preserves errno.
1714         (set_stat): Remove arg symlink_flag; subsumed by typeflag.
1715         (delay_set_stat, repair_delayed_set_stat): New functions.
1716         (make_directories): Avoid mkdir where last part of path is "..".
1717         Create a struct delayed_set_stat for each directory made.
1718         (prepare_to_extract): Renamed from unlink_destination, and
1719         return 0 immediately if to_stdout_option; all callers changed.
1720         (maybe_recoverable): New parameter interdir_made.
1721         Add support for --overwrite.
1722         (extract_sparse_file, extract_archive):
1723         Quote arbitrary strings in diagnostics.
1724         (extract_archive): By default, warn about ".." in member names, and skip them.
1725         Don't open files with O_NONBLOCK or O_APPEND.
1726         Open with O_TRUNC only if --overwrite; otherwise, use O_EXCL to avoid
1727         overwriting them.  Pass only rwxrwxrwx permissions to `open' and `mkdir',
1728         minus the current umask.  Keep track of intermediate directories made,
1729         to avoid looping when making x/../x when x doesn't exist; the
1730         earlier code solved this in a different way that didn't fit well
1731         into the new scheme.  Don't extract permissions onto existing
1732         directories unless --overwrite is given.  Do not add -wx------
1733         permissions to new directories permanently; just do it temporarily.
1734         Remove no-longer-needed hack with MSDOS and directory time stamps.
1735         (apply_delayed_set_stat): New argument specifies which directories to
1736         fix statuses of.  Do not wait until the end of extraction to fix
1737         statuses; instead, fix a directory's status once we exit that directory.
1738         This requires less memory and does the right thing in some cases
1739         where the old method didn't.
1740         (fatal_exit): New function.
1742         * src/incremen.c (<quotearg.h>): New include.
1743         (get_directory_contents, gnu_restore):
1744         Check for readdir and closedir errors.
1745         (get_directory_contents, read_directory_file, gnu_restore):
1746         Quote arbitrary strings in diagnostics.
1747         (get_directory_contents, read_directory_file, write_directory_file):
1748         Don't assume that gettext preserves errno.
1750         * src/create.c (<quotearg.h>): New include.
1751         (start_header): Use `member names' to refer to archive member names, not
1752         `archive names'.  Warn about `..' in member names.
1753         (finish_sparse_file, dump_file):
1754         Quote arbitrary strings in diagnostics.
1755         (finish_sparse_file, dump_file):
1756         Don't assume that gettext preserves errno.
1757         (dump_file): Don't use `access' to determine whether a directory is readable;
1758         this isn't reliable if tar is setuid.  Use `opendir' instead.
1759         Check for readdir and closedir failures.
1760         Don't dump sockets as if they were fifos; just warn and skip.
1762         * src/delete.c (move_archive):
1763         Don't report fatal error merely because sizes don't fit
1764         into struct mtop values; fall back on lseek instead.
1765         Say `Cannot' uniformly, instead of `Could not' sometimes and `Cannot' others.
1766         Say `reposition' instead of `re-position'.
1767         (delete_archive_members):
1768         Set archive to STDOUT_FILENO before outputting trailing buffer.
1770         * src/compare.c (<quotearg.h>): New include.
1771         (diff_init): Use `Cannot' uniformly, instead of `Could not' sometimes
1772         and `Cannot' others.
1773         (report_difference, diff_archive):
1774         Quote arbitrary strings in diagnostics.
1775         (process_rawdata, diff_sparse_files, get_stat_data, diff_archive, seek_warn):
1776         Don't assume that gettext preserves errno.
1777         (diff_archive): Don't open regular files with O_NONBLOCK.
1778         Preserve access times of files if --atime.
1780         * src/common.h (FATAL_ERROR): Use new fatal_exit function to exit.
1781         (FATAL_ERROR, USAGE): Don't return 0.
1782         (enum old files): New enum.
1783         (old_files_option): New variable, replacing keep_old_files_option and
1784         unlink_first_option.
1785         (apply_delayed_set_stat): Now takes char const * param.
1786         (fatal_exit, contains_dot_dot, chdir_fatal, close_error,
1787         closedir_error, exec_fatal, mkfifo_error, mknod_error, open_error,
1788         open_fatal, open_warn, opendir_error, opendir_warn, read_error,
1789         read_fatal, readdir_error, readdir_warn, readlink_error,
1790         readlink_warn, seek_error, seek_warn, stat_error, stat_warn,
1791         truncate_error, truncate_warn, unlink_error, waitpid_error,
1792         write_error, write_fatal, xfork, xpipe, quote, quote_n): New decls.
1794         * src/buffer.c:
1795         (xclose, xdup2, child_open_for_compress, child_open_for_uncompress,
1796         archive_write_error, archive_read_error, flush_archive, close_archive,
1797         init_volume_number, new_volume):
1798         Don't assume that gettext preserves errno.
1800         (xdup2): Don't report errno if dup returns an unexpected nonnegative value.
1801         (open_archive): Reject multivolume verify attempts a bit earlier.
1802         Rename local variable `access', in case it's defined by system header.
1804         (open_archive, backspace_output): Use `Cannot' uniformly, instead of
1805         `Could not' sometimes and `Cannot' others.
1807         (open_archive, flush_read, flush_archive, close_archive, new_volume):
1808         Quote arbitrary strings in diagnostics.
1810         (read_error): Set archive to STDOUT_FILENO temporarily when writing
1811         archive buffer.
1813         (init_volume_number): Check for input and output errors in volno_file.
1815         (new_volume): Use new fatal_exit function to exit, and new xfork
1816         function to fork.
1818         * m4/Makefile.am (EXTRA_DIST): Add c-bs-a.m4.
1820         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/c-bs-a.m4.
1822         * doc/tar.texi: Add --overwrite.
1823         --absolute-names rejects ".." in names.
1825         * lib/quotearg.c: Add support for multibyte characters.
1826         (ISGRAPH): Remove.
1827         (ISPRINT): New macro.
1828         (<wchar.h>): Include if HAVE_MBRTOWC && HAVE_WCHAR_H.
1829         (isprint, mbrtowc, mbsinit, mbstate_t): New macros,
1830         defined if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
1831         (quotearg_buffer_restyled): New function, with most of the old
1832         quotearg_buffer's contents.
1833         Major rewrite to support multibyte characters.
1834         (quotearg_buffer): Now just calls quotearg_buffer_restyled.
1836         * m4/c-bs-a.m4: New file.
1838         * lib/Makefile.am: Use ## for copyright notice.
1840         * scripts/Makefile.am: Use ## on copyright notice.
1842         * doc/Makefile.am:
1843         ($(srcdir)/tar.info, tar.dvi): We now use texinfo 4.0.
1845 1999-12-05  Paul Eggert  <eggert@twinsun.com>
1847         * doc/ChangeLog, lib/ChangeLog, scripts/ChangeLog,
1848         src/ChangeLog, tests/ChangeLog: Remove these files.
1849         * ChangeLog.1: New file, incorporating the above files, plus old
1850         ChangeLog entries.
1851         * Makefile.am (EXTRA_DIST): Add ChangeLog.1.
1853 1999-12-05  Dale Worley  <worley@ariadne.com>
1855         * src/compare.c (<utime.h>, struct utimbuf): Add.
1856         (diff_archive): Restore access times if --atime.
1857         * doc/tar.texi: Explain that --atime also preserves modification time.
1859 1999-12-04  Gerhard Poul  <gpoul@gnu.org>
1861         * ABOUT-NLS: Update to latest version from ftp.gnu.org.
1862         * BACKLOG, TODO: Remove.
1863         * Makefile.am (all-local, BABYL, dist-zoo, id, ID): Remove.
1864         * README: Bring up to date.
1866 1999-12-03  Paul Eggert  <eggert@twinsun.com>
1868         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.15.
1870         * src/compare.c (diff_archive):
1871         Do not set errno to EPIPE; we no longer use perror.
1873         * src/create.c (dump_file):
1874         If a parent directory said that a file should be there but it is
1875         absent, diagnose it as being removed in the meantime.
1876         Do not pass meaningless errno to ERROR when reporting that the
1877         file changed as we read it.
1878         Report that a file changed if its ctime changes; this is more
1879         sensitive than mtime+size, and more accurate.
1881         * src/incremen.c (enum children): New type.
1882         (struct directory): Change old char allnew member to new enum children
1883         children member.
1884         All uses changed.
1885         (get_directory_contents): When doing an incremental dump that does
1886         not cross filesystem boundaries, dump the mount points, even though
1887         they are in a different filesystem.  This is for convenience when
1888         restoring, and for consistency with non-incremental dumps.
1889         This requires a 3-way flag for keeping track of which children we want,
1890         so we use enum children rather than boolean.
1892         * src/open3.c (modes): Remove.
1893         (open3): Remove unportable assumptions about flag encodings.
1894         Use `stat' instead of `access' for testing file existence,
1895         to avoid problems with setuid programs.
1897         * src/names.c (name_next): If file names are given both in the
1898         command line (e.g. via -C) and in a file (via -T), do not
1899         ignore the command-line names.
1901         * m4/uintmax_t.m4: Backport to autoconf 2.13.
1903         * doc/tar.texi: Clarify getdate authorship.
1905 1999-11-23  Paul Eggert  <eggert@twinsun.com>
1907         * lib/Makefile.am (DISTCLEANFILES): New macro.
1909         * configure.in (tar_fnmatch_hin):
1910         Remove; it runs afoul of a bug in autoconf 2.13.
1911         Instead, always link fnmatch.h to some file, even if it's a throwaway.
1913 1999-11-19  Paul Eggert  <eggert@twinsun.com>
1915         * m4/largefile.m4: Update serial.
1917 1999-11-18  Paul Eggert  <eggert@twinsun.com>
1919         * m4/largefile.m4 (AC_SYS_LARGEFILE_FLAGS): Work around a bug in
1920         the QNX shell, which doesn't propagate exit status of failed
1921         commands inside shell assignments.
1923 1999-11-07  Paul Eggert  <eggert@twinsun.com>
1925         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.14.
1927         * configure.in (AC_PREREQ): Bump to 2.13.
1928         (ALL_LINGUAS): Add pt_BR, ja.
1929         (AC_FUNC_FNMATCH): Remove lib/funmatch.h before invoking, not after.
1930         (tar_cv_path_RSH): Prefer a non-symlink rsh to a symlink one,
1931         for AIX crossbuilds.
1933         * doc/tar.texi: New node create options for --ignore-failed-read.
1934         Remove unused version control symbols.
1935         Modernize texinfo usage.
1937         * src/tar.c (usage): Add examples.
1939         * m4/fnmatch.m4 (AC_FUNC_FNMATCH):
1940         Include fnmatch.h when testing fnmatch.
1942         * src/common.h (collect_and_sort_names): New decl.
1944         * src/list.c (from_header):
1945         Handle 32-bit two's complement negative time stamps
1946         even if the leading octal digit is 2 or 3.
1948         * src/extract.c (set_stat): Remove duplicate code.
1950         * src/create.c (to_chars): Remove trailing newline from warning.
1951         (dump_file): Ignore doors.
1952         (finish_header): Report block numbers with origin 0, not origin 1.
1954         * src/rmt.c: Include getopt.h.
1955         (long_opts): New constant.
1956         (usage): New function.
1957         (main): Implement --help and --version.
1958         Output usage message if arguments are bad.
1960 1999-10-10  Paul Eggert  <eggert@twinsun.com>
1962         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.13.
1964         * README: Remove --with-dmalloc.
1965         Add --disable-largefile.
1966         Remove old NeXT dirent problems, or AIX valloc problems.
1967         Remove old union wait advice, and old %lld advice.
1968         Remove advice about FreeBSD 2.1.7, ISC 4.1mu, Ultrix `make'.
1970         * doc/tar.texi: Clarify documentation for portable file names.
1972         * configure.in (AM_WITH_DMALLOC): Remove.
1973         (ALL_LINGUAS): Add ja.
1975         * src/tar.c (decode_options):
1976         Invalid dates are now treated as (time_t) -1.
1977         Redo version message to conform to GNU standards.
1979         * src/create.c (dump_file):
1980         Fix typo: last two args to dump_file were interchanged.
1981         * src/update.c (update_archive): Likewise.
1983         * src/common.h (tartime): New decl.
1985         * src/list.c (tartime): Now extern.
1986         (read_and): Invalid headers cause errors, not warnings.
1988 1999-10-03  Paul Eggert  <eggert@twinsun.com>
1990         * lib/getdate.y (__attribute__):
1991         Don't use if GCC claims to be before 2.8; this is
1992         needed for OPENStep 4.2 cc.  Also, don't use if strict ANSI.
1994 1999-09-25  Paul Eggert  <eggert@twinsun.com>
1996         * lib/fnmatch.c, lib/fnmatch.hin: Merge changes from latest glibc.
1997         * lib/getopt.c, lib/getopt.h, lib/getopt1.c: Likewise.
1999         * tests/incremen.sh: Add yet another sleep.
2001 1999-09-24  Paul Eggert  <eggert@twinsun.com>
2003         * NEWS: A read error now causes a nonzero exit status.
2005         * src/create.c (to_chars): Fix base-256 output.
2007         * src/buffer.c (write_error):
2008         Read error is an error, not just a warning.
2010 1999-09-24  Paul Eggert  <eggert@twinsun.com>
2012         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.12.
2014         * src/tar.c (<time.h>): Include.
2015         (time): Declare if not defined.
2016         (confirm): Don't read past EOF.
2017         (long_options, usage): Add --no-same-owner, --no-same-permissions.
2018         (main): Use clock_gettime if available.
2020         * tests/Makefile.am (TESTS): Add incremen.sh
2021         (INCLUDES): Add -I../lib, for fnmatch.h.
2023         * src/update.c (update_archive):
2024         Remove call to name_expand; had no effect.
2025         Use chdir_do to change into directory.
2026         Use deref_stat instead of stat.
2027         Use add_avoided_name to mark names to be avoided; the old method of
2028         setting a bit with the name caused all descendants of that name to
2029         be avoided, in some circumstances.
2031         * tests/incremen.sh: Remove unnecessary sleeps.
2033         * src/names.c (name_next): Go back to using plain chdir.
2034         (name_gather): Use chdir_arg to keep track of arguments to chdir.
2035         (addname): Likewise.
2036         (name_match): Use chdir_do to act on chdir args.
2037         (merge_sort): Moved here from incremen.c.
2038         (compare_names, add_hierarchy_to_namelist, collect_and_sort_names):
2039         Likewise.
2040         (name_expand): Remove.
2041         (name_from_list): Skip fake names.
2042         Use chdir_do to act on chdir args.
2043         (struct avoided_name): New struct.
2044         (avoided_names): New var.
2045         (add_avoided_name, is_avoided_name): New functions.
2047         * src/system.h (stat, lstat): Define in terms of statx on
2048         STX_HIDDEN && !_LARGE_FILES /* AIX */ hosts.
2049         (UCHAR_MAX): New macro.
2050         (TYPE_MAXIMUM): Cast to arg type, for types narrow than int.
2052         * m4/largefile.m4: Work around GCC 2.95.1 bug with HP-UX 10.20.
2054         * src/incremen.c (<time.h>): Remove include; no longer used.
2055         (time): Remove decl.
2056         (time_now): Remove.
2057         (get_directory_contents): Use deref_stat.
2058         Consider a subdirectory to be all new only if
2059         listed_incremental_option or if it its timestamp is newer than the
2060         cutoff.
2061         (add_hierarchy_to_namelist, merge_sort): Move to names.c.
2062         (read_directory_file): Now extern.  Do not set time_now.
2063         (write_directory_file): Renamed from write_dir_file.
2064         Use start_time instead of time_now.
2065         (compare_names, collect_and_sort_names): Move to names.c.
2067         * src/mangle.c (<time.h>): Remove; not used.
2068         (time): Do not declare.
2070         * src/misc.c (chdir_from_initial_wd): Remove.
2071         (deref_stat): New function.
2072         (struct wd): New struct.
2073         (wd, wds, wd_alloc): New variables.
2074         (chdir_arg, chdir_do): New function.
2076         * src/compare.c (get_stat_data): Use deref_stat.
2078         * src/common.h (name_expand): Remove.
2080         * src/list.c (time): Declare if not defined.
2081         (base_64_digits): Moved here from create.c.
2082         (base64_map): Use UCHAR_MAX for size, not less-clear (unsigned char)
2083         -1.
2084         (read_and): Don't get time from header unless we need it now;
2085         as getting time can cause duplicate diagnostics if bogus.
2086         Remove "Hmm, " from diagnostic.
2087         Use "Skipping to next header" uniformly.
2088         (from_header): Renamed from from_chars.  All uses changed.
2089         Allow different forms for unportable 2's complement numbers.
2090         Don't check for extended forms when parsing checksums.
2091         Parse base-256 output.
2092         (gid_from_header): Renamed from gid_from_chars.  All uses changed.
2093         (major_from_header): Renamed from major_from_chars.  All uses changed.
2094         (minor_from_header): Renamed from minor_from_chars.  All uses changed.
2095         (mode_from_header): Renamed from mode_from_chars.  All uses changed.
2096         (off_from_header): Renamed from off_from_chars.  All uses changed.
2097         (size_from_header): Renamed from size_from_chars.  All uses changed.
2098         (time_from_header): Renamed from time_from_chars.  All uses changed.
2099         Warn about future timestamps.
2100         (uid_from_header): Renamed from uid_from_chars.  All uses changed.
2101         (uintmax_from_header): Renamed from uintmax_from_chars.
2102         All uses changed.
2103         (tartime): New function, incorporating isotime.
2104         (isotime): Delete.
2105         (print_header): Use tartime.
2107         * src/create.c (to_chars): Fix typo in decl.
2108         Don't assign through char const *.
2109         Rename name_expand back to collect_and_sort_names.
2111         * src/extract.c (<time.h>): No need to include.
2112         (time): No need to declare.
2113         (now): Remove variable.
2114         (extr_init): Don't initialize `now'.
2115         Increment same_permissions_option and same_owner_option if we_are_root
2116         is nonzero; this supports the new --no-same-owner option.
2117         (set_stat): Use start_time instead of `now'.
2119         * src/create.c (struct link): Remove unused linkcount member.
2120         (base_64_digits): Move to list.c.
2121         (base_8_digits): Remove.
2122         (to_octal): New function, with some of old contents of to_base.
2123         (to_base): Remove.
2124         (to_base256): New function.
2125         (to_chars): Use base 256, not base 64, for huge values.
2126         (mode_to_chars): Don't use two's complement in GNU format or POSIX
2127         format.
2128         (dump_file): Interchange last two arguments. If TOP_LEVEL is negative,
2129         it means we have an incremental dump where we don't know whether this
2130         is a top-level call.
2131         Use deref_stat instead of statx / stat / lstat.
2132         Cast result of alloca.
2133         Check for dates if 0 < top_level, not if listed_incremental_option.
2134         Move multiple-link check after directory check.
2135         Do not dump avoided names.
2136         Dump hard links to symbolic names as links, not as separate
2137         symbolic links.
2138         start_header cannot return a null pointer, so don't test for it.
2139         Likewise for find_next_block.
2141         * src/buffer.c, src/common.h (<human.h>): Include.
2142         (read_error): Read error is an error, not just a warning.
2143         (print_total_written): Also print human-readable byte count, and
2144         bytes/s.
2145         (open_archive, flush_write): Use start_time, not current time.
2146         (flush_read): Report about garbage bytes ignored at end of archive,
2147         but act on non-garbage bytes (instead of ignoring them).
2148         (new_volume): Use WARN for warnings.
2150         * doc/Makefile.am:
2151         ($(srcdir)/tar.info): Add -I$(srcdir) so that subdir builds work.
2153         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/fnmatch.m4.
2155         * m4/Makefile.am (EXTRA_DIST): Add fnmatch.m4.
2157         * lib/Makefile.am (noinst_HEADERS):
2158         Rename fnmatch.h to fnmatch.hin; add human.h.
2159         (libtar_a_SOURCES): Add human.c, xstrtoul.c.
2160         (INCLUDES): Remove -I.. -I$(srcdir) -- automake adds this for us.
2162         * src/Makefile.am (rmt_LDADD, tar_LDADD): New macros.
2164         * lib/fnmatch.c (strchrnul):
2165         Define to __strchrnul if _LIBC, to our own replacement otherwise.
2166         Do not define if !_LIBC and if it already exists.
2167         (internal_fnmatch): Use it.
2169         * configure.in (tar_LDADD): New variable, used only when linking tar.
2170         (rmt_LDADD): Similarly, for rmt.
2171         (AC_FUNC_FNMATCH): Link fnnmatch.hin to fnmatch.h if we're using our
2172         fnmatch.c; otherwise, use the system fnmatch.h.
2174         * doc/tar.texi: Add --no-same-owner, --no-same-permissions.
2175         Modernize sample backup script.
2177         * THANKS: Martin Goik's email address has changed.
2179         * m4/fnmatch.m4: New file.
2181 1999-09-03  Paul Eggert  <eggert@twinsun.com>
2183         * lib/lchown.h (ENOSYS): Don't use ENOMSG; it's not in NeXTStep3.3.
2184         Use EINVAL instead.
2186 1999-08-29  Paul Eggert  <eggert@twinsun.com>
2188         * lib/getdate.y (get_date):
2189         Rename outermost local `probe' to `quarter'.
2190         Rename latter local `tm' to probe_tm.
2191         From: Jim Meyering <meyering@ascend.com>
2192         Message-ID: <uryn1vafyyc.fsf@ixi.eng.ascend.com>
2194 1999-08-28  Paul Eggert  <eggert@twinsun.com>
2196         * lib/getdate.y (PC): New macro; use it when possible.
2197         (number): Handle `Nov 11 1996' example correctly.
2198         See Risks Digest 20.55 (1999-08-27)
2199         http://catless.ncl.ac.uk/Risks/20.55.html#subj18
2201 1999-08-23  Paul Eggert  <eggert@twinsun.com>
2203         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.11.
2205         Remove minor cases of lint from many source files: this includes
2206         unnecessary casts, uses of NULL, etc.
2208         * configure.in (AC_PROG_YACC): Remove.
2209         (YACC): Always use bison.
2210         (AC_STRUCT_TIMEZONE): Add.
2211         (AC_REPLACE_FUNCS): Add strcasecmp, strncasecmp.
2213         * doc/tar.texi: --bzip2 is now -I.  Remove obsolete time zone info.
2214         Fix spelling.
2216         * lib/Makefile.am (EXTRA_DIST): Add strcasecmp.c, strncasecmp.c.
2217         ($(srcdir)/getdate.c): Rename y.tab.c to getdate.c only if successful.
2219         * lib/strcasecmp.c, lib/strncasecmp.c: New files.
2221         * src/common.h (merge_sort): Remove decl; no longer exported.
2223         * src/system.h (voidstar): Remove.
2224         (memcpy, memcmp): Cast args.
2225         ("xalloc.h"): Add include.
2226         (xmalloc, xrealloc): Remove decl.
2228         * src/mangle.c (time): Do not declare if defined.
2229         (first_mangle, mangled_num): Remove.
2231         * src/list.c (from_chars): Report out-of-range values more precisely.
2232         (off_from_chars): Do not allow negative offsets.
2233         (uid_from_chars): Allow negative uids.
2235         * src/create.c (linklist): Now static.
2236         (to_chars): Fix wording of message to match from_chars.
2238         * src/misc.c (merge_sort): Move to incremen.c.
2239         * src/incremen.c (merge_sort): Move here from misc.c; now static.
2240         It's too painful to make it both generic and portable.
2241         (read_directory_file): "timestamp" -> "time stamp" in messages.
2243         * src/tar.c (long_options, usage, main): -y is now -I (for --bzip).
2244         (usage): Fix misspelling.
2245         (OPTION_STRING): -y is now -I.
2246         (decode_options): Use -1, not EOF, for getopt_long result.
2247         Fix typo when invoking xstrtoumax: look for LONGINT_OK, not LONG_MAX.
2248         Handle operands after any "--" argument.
2249         (main): Report any output errors.
2251         * src/rmt.c (main): status is ssize_t, not long.
2253         * src/names.c (name_gather): Handle trailing -C option correctly.
2254         (addname): use memcpy, not strncpy, to copy a string of known length.
2255         (name_match): Handle trailing -C option correctly.
2256         Propagate -C option to following files.
2257         (name_match, name_scan): Remove redundant matching code.
2259         * src/buffer.c (open_archive): Use American spelling in diagnostic.
2261         * lib/getdate.y: Major rewrite.  Add copyright notice.
2262         (<stdio.h>): Include only if testing.
2263         (ISUPPER): Remove.
2264         (ISLOWER): New macro.
2265         (<string.h>): Include if HAVE_STRING_H, not USG.
2266         (bcopy): Remove.
2267         (yymaxdepth, ..., yycheck): Don't bother to redefine, since we assume
2268         bison.
2269         (EPOCH_YEAR): Renamed from EPOCH.
2270         (table): Renamed from TABLE.
2271         (meridian): Now an anonymous enum.
2272         (struct parser_control): New type.
2273         (YYLEX_PARAM, YYPARSE_PARAM, YYSTYPE): New macros.
2274         (yyInput, ..., yyRelYear): Migrated into struct parser_control.
2275         (%pure_parser): Added, so that the parser is pure.
2276         (%union): Removed; the type is now just plain int.
2277         All %type directives removed.
2278         (tLOCAL_ZONE): New %token.
2279         (month_day_table): Renamed from MonthDayTable.
2280         (gmtime, localtime, mktime, time): Declare only if not defined.
2281         (meridian_table): New table.
2282         (dst_table): New table.
2283         (units_table): renamed from UnitsTable.
2284         (relative_time_table): Renamed from OtherTable.
2285         (time_zone_table): Renamed from TimezoneTable.  Modernized.
2286         (military_table): Renamed from MilitaryTable.
2287         (to_hour): Renamed from ToHour.
2288         (to_year): Renamed from ToYear.
2289         (lookup_zone): New function.
2290         (LookupWord): Renamed from lookup_word.  Use lookup_zone for time
2291         zones.
2292         (yylex): Now reentrant.  All callers changed.
2293         (get_date): Add support for local time zone abbreviations.
2294         Make it reentrant.
2296 1999-08-20  Paul Eggert  <eggert@twinsun.com>
2298         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.10.
2300         * src/create.c (to_chars): Generate GNU base-64 representation
2301         if we are generating an old or new GNU format tar file for a
2302         number that can't be represented with the POSIX format.
2304         * configure.in (AC_CHECK_FUNCS): Add fchdir.
2305         (AM_FUNC_GETLINE): Add.
2306         (LIBOBJS): Add getline.o to workaround comment.
2307         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/getline.m4.
2308         * m4/Makefile.am (EXTRA_DIST): Add getline.m4.
2309         * lib/Makefile.am (noinst_HEADERS): Add getline.h, save-cwd.h.
2310         (libtar_a_SOURCES): Add save-cwd.c, xgetcwd.c.
2311         * lib/getline.c, lib/getline.h, lib/save-cwd.c,
2312         lib/save-cwd.h, m4/getline.m4: New files.
2314         * src/misc.c (<save-cwd.h>): Include.
2315         (chdir_from_initial_wd): New function.
2317         * src/names.c (name_next): Use chdir_from_initial_wd, not chdir.
2318         (name_gather): Handle `-C x -C y' correctly.
2319         Do not rely on addname to handle -C.
2320         (addname): New CHANGE_DIR parameter.  All callers changed.
2321         Remove ugly calls to getcwd; no longer needed.
2322         (name_match, name_from_list): Use chdir_from_initial_wd, not chdir.
2324         * src/incremen.c (listed_incremental_stream): New var.
2325         (read_directory_file): Remove arbitrary limits on file name length.
2326         Do not attempt to get the working directory; we can bypass this
2327         on fchdir hosts.  Open the listed_incremental_option file for both
2328         read and write instead of opening it twice.  Check for I/O errors
2329         when doing I/O to this file.  Check for invalid data in the file,
2330         and report line numbers of invalid data.
2331         (write_dir_file): Likewise.
2332         (collect_and_sort_names): Use chdir_from_initial_wd, not chdir.
2333         Do not invoke write_dir_file; that's our caller's responsibility.
2335         * src/list.c (max): New macro.
2336         (isotime): Now takes time_t, not time_t *.  Report the decimal values
2337         of times that can't be broken down.
2338         (print_header): Don't assume that major and minor device numbers can
2339         fit into uintmax_t.
2341         * src/common.h (struct name): change_dir is now char const *.
2342         (write_directory_file): Remove unused decl.
2343         (STRINGIFY_BIGINT): Assume b always points to UINTMAX_STRSIZE_BOUND
2344         chars; the old `sizeof (b)' broke when b was a pointer not an array.
2345         (chdir_from_initial_wd): New decl.
2346         (addname): New 2nd arg.
2348         * THANKS: Torsten Lull -> Catrin Urbanneck
2350 1999-08-18  Paul Eggert  <eggert@twinsun.com>
2352         * configure.in (HAVE_GETHOSTENT, HAVE_SETSOCKOPT):
2353         Don't depend on ac_cv_func variables.
2354         From Albert Chin-A-Young <china@thewrittenword.com>.
2356 1999-08-18  Paul Eggert  <eggert@twinsun.com>
2358         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.9
2360         * m4/signedchar.m4: New file.
2361         * configure.in (pe_AC_TYPE_SIGNED_CHAR): Add.
2362         * src/system.h (signed_char): New macro.
2363         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/signedchar.m4.
2364         * m4/Makefile.am (EXTRA_DIST): Add signedchar.m4.
2366         * src/create.c (write_eot): Write at least two zero blocks.
2368         * src/extract.c (extract_archive): Fix sparse array bug:
2369         we did not find end of array correctly.
2371         * src/compare.c: (fill_in_sparse_array, diff_sparse_files):
2372         Don't assume find_next_block yields nonnull.
2373         * src/extract.c (extract_sparse_file, extract_archive): Likewise.
2374         * src/list.c (skip_extended_headers): Likewise.
2376         * src/list.c (read_and, list_archive): Simplify code.
2377         (read_header): Fix computation of signed checksums on machines where
2378         char is unsigned.
2379         Do not consider a block to be zero unless all its bytes are zero,
2380         even the checksum bytes.  Do not attempt to parse the checksum of
2381         a zero block.  Fix memory leak with long names and links.
2382         (from_chars): Accommodate a buggy tar that outputs leading NUL
2383         if the previous field overflows.
2385         * src/misc.c (quote_copy_string): Generate \177 for '\177', not
2386         \?, for portability to non-ASCII hosts.
2388 1999-08-16  Paul Eggert  <eggert@twinsun.com>
2390         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.8.
2392         * src/extract.c (make_directories): Do not chown intermediate
2393         directories, even if we are root.
2395         * src/list.c (read_header): Fix bugs when interpreting
2396         POSIX-compliant headers that do not contain null bytes in the
2397         header or link names.
2399 1999-08-14  Paul Eggert  <eggert@twinsun.com>
2401         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.7.
2403         * configure.in (AC_CHECK_HEADERS): Remove sys/wait.h.
2404         (AC_HEADER_SYS_WAIT): Add.
2405         (AC_REPLACE_FUNCS): Add waitpid.
2406         (tar_cv_header_union_wait, HAVE_UNION_WAIT): Remove.
2407         * lib/waitpid.c: New file.
2408         * lib/Makefile.am (EXTRA_DIST): Add waitpid.c.
2409         * src/system.h (WCOREDUMP): Remove; no longer used.
2410         (WIFSTOPPED): Likewise.
2411         (WEXITSTATUS, WIFSIGNALED): Default to Solaris 7 versions.
2412         * src/buffer.c (child_open_for_compress): Undo previous change.
2413         (close_archive): Use waitpid, POSIX-style, instead of old BSD style.
2414         (new_volume): Likewise.
2416         * src/buffer.c, src/extract.c, src/incremen.c (time):
2417         Don't declare if defined.
2418         * src/extract.c (extr_init): Remove unneeded cast around 0 arg to time.
2419         * src/incremen.c (read_directory_file):
2420         Invoke `time' the same way everyone else does.
2421         Check validity of --listed-incremental file contents a bit better.
2422         Do not worry about --after-date-option; tar.c now checks this.
2423         * src/list.c (isotime): Report ??? if localtime returns null.
2424         Don't assume years fit into four digits.
2425         Don't append trailing newline.
2426         (print_header): Report ??? if localtime returns null;
2427         Don't assume years fit into four digits.
2429         * src/compare.c (diff_archive): Do not fall back on absolute name
2430         when --absolute-names is not specified.
2432         * src/create.c (start_header):
2433         Include text of ignored filesystem prefix in warning.
2434         (create_archive): Check for excluded names when doing incremental
2435         pass through directory.
2436         (dump_file): Do not dump old files explicitly given on command line
2437         when using --listed-incremental.  Do not strip ./ prefix from names.
2439         * src/tar.c: -g now implies after_date_option = 1.
2440         -g and -N are now incompatible options.
2442         * doc/tar.texi: Explain --exclude better.  Don't strip leading `./'.
2444 1999-08-11  Jeff Dairiki  <dairiki@dairiki.org>
2446         * src/list.c (read_header): Don't parse OLDGNU_FORMAT
2447         incremental headers as POSIX prefixes.
2449 1999-08-11  Paul Eggert  <eggert@twinsun.com>
2451         * NEWS, configure.in: Version 1.13.6.
2453         * configure.in (ALL_LINGUAS): Add pt_BR.
2454         * po/pt_BR.po: New file.
2456         * doc/Makefile.am ($(srcdir)/tar.info, $(srcdir)/header.texi):
2457         Renamed from tar.info and header.texi; adjust actions so that
2458         they work in other directories.
2460         * doc/tar.texi: Add -y and --bzip2.
2461         Patterns containing / now exclude only file names whose prefix match.
2463         * lib/exclude.h (excluded_filename): New option parameter.
2464         (add_exclude_file): New ADD_FUNC parameter.
2465         (excluded_pathname): Remove decl.
2466         * lib/exclude.c (_GNU_SOURCE):
2467         Remove; no longer needed since we don't use FNM_ macros.
2468         (excluded_filename): Renamed from excluded_filename_opts.
2469         (excluded_filename, excluded_pathname): Remove.
2470         (add_exclude_file): New ADD_FUNC parameter.
2472         * po/POTFILES.in: Add lib/quotearg.c.
2474         * src/buffer.c (_GNU_SOURCE): Define.
2475         (<fnmatch.h>): Include unconditionally.
2476         (child_open_for_compress): Dup after closing, to avoid possible file
2477         descriptor exhaustion.
2478         (flush_write): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
2479         (flush_read): Likewise.
2481         * src/common.h (LG_8, LG_64): New macros.
2482         (excluded_with_slash, excluded_without_slash): New vars.
2483         (excluded): Remove.
2484         (base_64_digits): New decl.
2485         (gid_to_chars, major_to_chars, minor_to_chars, mode_to_chars,
2486         off_to_chars, size_to_chars, time_to_chars, uid_to_chars,
2487         uintmax_to_chars,
2488         GID_TO_CHARS, MAJOR_TO_CHARS, MINOR_TO_CHARS, MODE_TO_CHARS,
2489         OFF_TO_CHARS, SIZE_TO_CHARS, TIME_TO_CHARS, UID_TO_CHARS,
2490         UINTMAX_TO_CHARS):
2491         Renamed from gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
2492         off_to_oct, size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
2493         GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, OFF_TO_OCT,
2494         SIZE_TO_OCT, TIME_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT,
2495         respectively.  All definitions and uses changed.
2496         (excluded_name): New decl.
2498         * src/compare.c (diff_archive):
2499         Open files with O_NONBLOCK instead of O_NDELAY.
2501         * src/create.c (base_64_digits): New constant.
2502         (base_8_digits): New macro.
2503         (MAX_VAL_WITH_DIGITS): New macro.
2504         (to_base): First half of old to_oct.  Support base 64 too.
2505         (to_chars): Other half of old to_oct, for 64-bit support.
2506         (GID_NOBODY, UID_NOBODY): Don't define if the headers don't.
2507         (gid_substitute, uid_substitute): Look up names dynamically if
2508         GID_NOBODY and UID_NOBODY aren't defined; use -2 if all else fails.
2509         (mode_to_chars): Renamed from mode_to_oct.
2510         Support negative values in all the _to_chars functions.
2511         (start_header): Use FILESYSTEM_PREFIX_LEN instead of MSDOS ifdef.
2512         Abort if archive format is DEFAULT_FORMAT when it shouldn't be.
2513         (dump_file): Inspect entire pathname, not just new file name
2514         component, when deciding whether to exclude it.
2516         * src/extract.c (extract_archive):
2517         Open files with O_NONBLOCK instead of O_NDELAY.
2519         * src/incremen.c (get_directory_contents):
2520         Inspect entire pathname, not just new file name
2521         component, when deciding whether to exclude it.
2523         * src/list.c (<fnmatch.h>): Do not include.
2524         (from_chars): Renamed from from_oct.  New parameter specifing
2525         the negative of the minimum allowed value.  Support negative
2526         and base-64 values.
2527         (base64_map): New var.
2528         (base64_init): New function.
2529         (print_header): Output numeric uids and gids if numeric_owner_option.
2531         * src/misc.c (quote_copy_string): Use LG_8 instead of constants.
2533         * src/names.c (_GNU_SOURCE): Define.
2534         (<fnmatch.h>): Include unconditionally.
2535         (excluded_name): New function, taking over duties of excluded_pathname.
2536         All uses changed.
2538         * src/rmt.c (decode_oflag): New function.
2539         (main): Use it to support symbolic open flags.
2541         * src/rtapelib.c (encode_oflag): New function.
2542         (rmt_open__): Do not allow newlines in the path.
2543         Propagate errno correctly.
2544         Decode symbolic open flags, if present.
2546         * src/system.h (FILESYSTEM_PREFIX_LEN, ISSLASH, O_ACCMODE, O_NONBLOCK):
2547         New macros.
2549         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
2550         New -y or --bzip2 option.
2551         (add_filtered_exclude): New function.
2552         (decode_options): Put excluded patterns with / into
2553         excluded_with_slash, and without / into excluded_without_slash.
2554         Compare newer_mtime_option to its new initial value
2555         TYPE_MINIMUM (time_t) when deciding whether more than one
2556         threshold date was specified.
2558 1999-07-20  Paul Eggert  <eggert@twinsun.com>
2560         * NEWS, configure.in: Version 1.13.5.
2562         * src/common.h (FATAL_ERROR): Invoke apply_delayed_set_stat
2563         before exiting.
2564         * src/buffer.c (new_volume): Likewise.
2565         * src/incremen.c (read_directory_file): Likewise.
2566         * src/tar.c (decode_options):
2567         ERROR ((TAREXIT_FAILURE, ... -> FATAL_ERROR ((0,
2568         for consistency.
2570         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13.4.
2571         * configure.in (AC_CHECK_FUNCS): Add lstat, readlink, symlink.
2573         * src/system.h (lstat): Define only if !HAVE_LSTAT && !defined lstat.
2574         (S_ISMPB, S_ISMPC, S_ISNWK): Remove unused macros.
2575         (S_ISBLK, S_ISCHR, S_ISCTG, S_ISFIFO, S_ISLNK, S_ISSOCK):
2576         Define to 0 if the corresponding S_IF* macro is not defined.
2577         (mkfifo): Do not define if already defined, or if S_IFIFO
2578         is not defined.
2580         * src/compare.c (diff_archive): Use HAVE_READLINK, not
2581         S_ISLNK, to determine whether to invoke readlink.
2582         * src/create.c (dump_file): Likewise.
2584         * src/extract.c (set_mode):
2585         Do not chmod unless we are root or the -p option was given;
2586         this matches historical practice.
2587         (unlink_destination): New function, which checks for unlink failures.
2588         (maybe_recoverable): Stay quiet if -U.
2589         (extract_archive): Use O_EXCL if unlink_first_option.
2590         Report unlink failures.
2591         Use HAVE_SYMLINK, not S_ISLNK, to determine whether symlink exists.
2592         Use HAVE_MKFIFO || defined mkfifo, not S_ISFIFO, to determine whether
2593         mkfifo exists.
2595         * src/incremen.c (get_directory_contents): Depend on
2596         S_ISHIDDEN, not AIX, to determine whether to invoke S_ISHIDDEN.
2598         * src/list.c: Remove S_IS* ifdefs.
2599         * src/misc.c (maybe_backup_file): Likewise.
2601         * src/misc.c (maybe_backup_file):
2602         "Virtual memory exhausted" -> "Memory exhausted",
2603         to conform to the other places this message is issued.
2605         * src/mangle.c (extract_mangle):
2606         Replace #ifdef S_ISLNK with #ifdef HAVE_SYMLINK.
2608         * src/rtapelib.c (rmt_open__):
2609         Remove typo that caused us to omit the first char
2610         of the basename.
2612 1999-07-16  Paul Eggert  <eggert@twinsun.com>
2614         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.13.3.
2616         * doc/tar.texi: A path name is excluded if any of its file name
2617         components matches an excluded pattern, even if the path name was
2618         specified on the command line.
2619         * src/create.c (create_archive): Likewise.
2620         * src/list.c (read_and): Likewise.
2621         * src/update.c (update_archive): Likewise.
2622         * lib/exclude.h (excluded_pathname): New decl.
2623         * lib/exclude.c (_GNU_SOURCE): Define.
2624         (FILESYSTEM_PREFIX_LEN, ISSLASH): New macros.
2625         (excluded_filename_opts): New function.
2626         (excluded_pathname): New function.
2628         * lib/Makefile.am (EXTRA_DIST):
2629         xstrtol.c moved here from libtar_a_SOURCES.
2630         (libtar_a_SOURCES): Move xstrtol.c to EXTRA_DIST.
2631         Remove xstrtoul.c; no longer needed.
2632         * lib/xstrtol.c: Remove.
2634         * src/tar.c (decode_options):
2635         Set newer_time_option to TYPE_MINIMUM, so that
2636         negative timestamps are handled correctly.
2637         Replace invocations of xstrtol and xstrtoul with xstrtoumax, for
2638         uniformity (and so that we don't need to have the other fns).
2639         (main): Remove call to init_total_written; no longer needed.
2641         * configure.in (AC_CHECK_SIZEOF): Remove no-longer-needed
2642         checks for unsigned long and long long.
2643         * src/arith.c: Remove.
2644         * src/Makefile.am (tar_SOURCES): Remove arith.c.
2645         * po/POTFILES.in: Remove src/arith.c.
2646         * src/arith.h: Use double, to simplify configuration gotchas.
2647         (tarlong): Now double.
2648         (TARLONG_FORMAT): New macro.
2649         (BITS_PER_BYTE, BITS_PER_TARLONG, SUPERDIGIT, BITS_PER_SUPERDIGIT,
2650         LONGS_PER_TARLONG, SIZEOF_TARLONG, struct tarlong,
2651         zerop_tarlong_helper, lessp_tarlong_helper, clear_tarlong_helper,
2652         add_to_tarlong_helper, mult_tarlong_helper, print_tarlong_helper,
2653         zerop_tarlong, lessp_tarlong, clear_tarlong, add_to_tarlong,
2654         mult_tarlong, print_tarlong): Remove.  All callers replaced with
2655         arithmetic ops.
2657         * src/common.h (init_total_written): Remove decl.
2659         * src/buffer.c (total_written):
2660         Remove; replaced with prev_written + bytes_written.
2661         (prev_written): New var.
2662         (init_total_written): Remove.
2663         (print_total_written): Use TARLONG_FORMAT instead of print_tarlong.
2665         * m4/ulonglong.m4 (jm_AC_TYPE_UNSIGNED_LONG_LONG):
2666         Make sure that we can shift, multiply
2667         and divide unsigned long long values; Ultrix cc can't do it.
2669         * lib/modechange.c (mode_compile): Use uintmax_t, not unsigned long.
2670         Check for any unknown bits, not just unknown bits left of the leftmost
2671         known bit.
2673         * lib/quotearg.c (quotearg_buffer):
2674         Don't quote spaces if C quoting style.
2675         * src/list.c (from_oct):
2676         Use C quoting style for error; omit trailing NULs.
2678 1999-07-14  Paul Eggert  <eggert@twinsun.com>
2680         * configure.in (AM_INIT_AUTOMAKE), NEWS: Version 1.13.2.
2682         * m4/xstrtoumax.m4 (jm_AC_PREREQ_XSTRTOUMAX): Check whether
2683         <inttypes.h> defines strtoumax as a macro (and not as a function).
2684         HP-UX 10.20 does this.
2686         * src/tar.c (usage): tar-bugs@gnu.org -> bug-tar@gnu.org
2687         * PORTS, README, TODO, doc/tar.texi: Likewise.
2689 1999-07-12  Paul Eggert  <eggert@twinsun.com>
2691         * configure.in (AM_INIT_AUTOMAKE): Version 1.13.1.
2692         (LIBOBJS): Add mktime.o to automake 1.4 bug workaround.
2694         * src/list.c (decode_header):
2695         Do not assume that S_IFBLK and S_IFCHR are defined.
2697         * src/create.c (start_header): Do not assume S_IFMT is defined.
2698         (dump_file): Remove unnecessary check for screwy apollo lossage.
2699         Do not assume S_IFBLK and S_IFCHR are defined.
2701         * src/extract.c (extract_archive):
2702         Test whether S_IFCHR and S_IFBLK are nonzero,
2703         not whether they are defined, for consistency with other tests.
2705         * src/buffer.c (is_regular_file):
2706         Don't succeed on files that we can't access due to
2707         permissions problems.
2708         (open_archive): Fix wording on fatal error message.
2709         Don't bother to stat /dev/null if the archive is not a character
2710         special device.
2712         * src/compare.c (process_rawdata, diff_sparse_files, diff_archive):
2713         Report an error, not a warning, for I/O errors.
2714         (process_rawdata, process_dumpdir, diff_sparse_files):
2715         Change ungrammatical "Data differs" to "Contents differ".
2716         (get_stat_data): Find hidden files on AIX.
2717         Accept file name as argument; all uses changed.
2718         (get_stat_data, diff_archive): Use system error message for
2719         nonexistent files rather than rolling our own.
2720         (diff_archive): Unknown file types are errors, not warnings.
2721         Normalize spelling of message to "File type differs".
2722         Use get_stat_data to get link status, for consistency.
2723         Do not inspect st_rdev for fifos.
2724         Do not assume st_mode values contain only file types and mode bits.
2725         Check for mode changes and device number changes separately.
2727         * src/update.c (append_file):
2728         Open the file before statting it, to avoid a race.
2729         Complain about file shrinkage only when we reach EOF.
2731 1999-07-08  Paul Eggert  <eggert@twinsun.com>
2733         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.13 released.
2735         * configure.in (AC_EXEEXT): Add.
2737         * lib/Makefile.am (noinst_HEADERS):
2738         Add basename.h, exclude.h.  Remove full-write.h.
2739         (libtar_a_SOURCES): Add exclude.c.
2741         * lib/basename.h, lib/exclude.c, lib/exclude.h, lib/safe-read.h:
2742         New files.
2743         * lib/full-write.c: Include safe-read.h instead of full-write.h.
2744         * lib/safe-read.h (safe_read): New decl.
2745         * src/rmt.c: Include safe-read.h.
2746         * src/rtapelib.c: Include basename.h, save-read.h.
2747         (rmt_open__): Use base_name to compute base name.
2749         * src/common.h:
2750         Include basename.h, exclude.h; don't include full-write.h.
2751         (exclude_option): Remove decl.
2752         (excluded): New decl.
2753         (add_exclude, add_exclude_file, check_exclude): Remove decls.
2755         * src/list.c (read_and):
2756         Use excluded_filename instead of check_exclude.
2757         Check base name of incoming file name, not entire file name, when
2758         deciding whether to exclude it.
2760         * src/create.c (finish_sparse_file):
2761         Use excluded_filename instead of check_exclude.
2762         Don't bother to stat excluded file names.
2763         * src/incremen.c (get_directory_contents): Likewise.
2765         * src/names.c (exclude_pool, exclude_pool_size,
2766         allocated_exclude_pool_size, simple_exclude_array,
2767         simple_excludes, allocated_simple_excludes,
2768         pattern_exclude_array, pattern_excludes,
2769         allocated_pattern_excludes, add_exclude, add_exclude_file,
2770         check_exclude):
2771         Remove; now done in ../lib/exclude.c.
2773         * src/tar.c (decode_options): Initialize `excluded'.
2774         Use new add_exclude_file and add_exclude functions.
2776 1999-07-05  Paul Eggert  <eggert@twinsun.com>
2778         * m4/gettext.m4: Use changequote rather than [[ ]].
2780         * lib/safe-read.c: Renamed from lib/full-read.c.
2781         (safe_read): Renamed from full_read.  All uses changed.
2782         * lib/safe-read.h, lib/full-write.h: New files.
2783         * lib/Makefile.am (noinst_HEADERS): Add full-write.h, safe-read.h.
2784         (libtar_a_SOURCES): Rename full-read.c to safe-read.c.
2785         * lib/full-write.c: Include full-write.h.
2786         * src/common.h: Include full-write.h, safe-read.h.
2787         * src/system.h: (full_read, full_write): Remove decls.
2789         * src/Makefile.am (datadir): New var; needed for Solaris gettext.
2791         * src/system.h (bindtextdomain, textdomain): undef before
2792         defining, to avoid preprocessor warnings with --disable-nls
2793         on hosts whose locale.h includes libintl.h.
2795         * lib/xstrtol.c (__strtol): Remove decl; it doesn't work if __strtol
2796         expands to a macro, which occurs in HP-UX 10.20 with strtoumax.
2797         (strtol, strtoul): New decls (for pre-ANSI hosts), to replace
2798         the above decl.
2800 1999-07-02  Paul Eggert  <eggert@twinsun.com>
2802         * Makefile.am (ACINCLUDE_INPUTS): Add $(M4DIR)/mktime.m4.
2803         * m4/mktime.m4: New file.
2804         * m4/Makefile.am.in, m4/README: Remove these files.
2805         * m4/Makefile.am (EXTRA_DIST): Add mktime.m4;
2806         remove README, Makefile.am.in.
2807         (Makefile.am): Remove rule; it didn't work in BSD/OS 4.0.
2808         * m4/jm-mktime.m4 (jm_FUNC_MKTIME): Invoke AC_FUNC_MKTIME,
2809         not AM_FUNC_MKTIME.
2811         * src/tar.c: Include signal.h.
2812         (SIGCHLD): Define to SIGCLD if SIGCLD is defined but SIGCHLD is not.
2813         (main): Ensure SIGCHLD is not ignored.
2815         (BACKUP_OPTION, DELETE_OPTION, EXCLUDE_OPTION, GROUP_OPTION,
2816         MODE_OPTION, NEWER_MTIME_OPTION, NO_RECURSE_OPTION, NULL_OPTION,
2817         OWNER_OPTION, POSIX_OPTION, PRESERVE_OPTION, RECORD_SIZE_OPTION,
2818         RSH_COMMAND_OPTION, SUFFIX_OPTION, USE_COMPRESS_PROGRAM_OPTION,
2819         VOLNO_FILE_OPTION, OBSOLETE_ABSOLUTE_NAMES,
2820         OBSOLETE_BLOCK_COMPRESS, OBSOLETE_BLOCKING_FACTOR,
2821         OBSOLETE_BLOCK_NUMBER, OBSOLETE_READ_FULL_RECORDS, OBSOLETE_TOUCH,
2822         OBSOLETE_VERSION_CONTROL): Make sure they can't be valid chars, so
2823         they don't overlap with char codes.  Use an enum instead of a lot
2824         of #defines.
2826         * src/system.h (ISASCII): Remove.
2827         (CTYPE_DOMAIN, ISDIGIT, ISODIGIT, ISPRINT, ISSPACE, S_ISUID,
2828         S_ISGID, S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP,
2829         S_IROTH, S_IWOTH, S_IXOTH, MODE_WXUSR, MODE_R, MODE_RW,
2830         MODE_RWX, MODE_ALL, SEEK_SET, SEEK_CUR, SEEK_END, CHAR_MAX,
2831         LONG_MAX): New macros.
2833         * src/incremen.c (ISDIGIT, ISSPACE): Remove; now in system.h.
2834         (read_directory_file): Cast ISSPACE arg to unsigned char.
2835         * src/misc.c (ISPRINT): Remove; now in system.h.
2836         (remove_any_file): Add brackets to pacify gcc -Wall.
2837         * src/list.c: Don't include <ctype.h>; system.h already does this.
2838         (ISODIGIT, ISSPACE): Remove; now in system.h.
2839         (decode_header): No need to AND mode with 07777; MODE_FROM_OCT
2840         does this now.
2841         (from_oct): Cast ISSPACE arg to unsigned char.
2843         * src/create.c (mode_to_oct): Translate modes from internal to
2844         external form.
2845         * src/list.c (mode_from_oct): Translate modes from external to
2846         internal form.  Do not complain about unrecognized mode bits.
2847         * src/common.h (TSUID, TSGID, TSVTX, TUREAD, TUWRITE, TUEXEC,
2848         TGREAD, TGWRITE, TGEXEC, TOREAD, TOWRITE, TOEXEC): Remove undefs.
2850         * src/extract.c: (extr_init, make_directories, extract_archive):
2851         Do not assume mode bits have traditional Unix values.
2852         * src/list.c (decode_mode): Likewise.
2853         * src/create.c (start_header, dump_file): Likewise.
2854         * src/buffer.c (child_open_for_compress,
2855         child_open_for_uncompress, open_archive, (close_archive): Likewise.
2856         * src/compare.c (diff_archive): Likewise.
2858         * src/extract.c (set_mode): Use %04 not %0.4 format.
2859         (extract_sparse_file): Do not use data_block uninitialized.
2860         Check for lseek failures.
2862         * src/rtapelib.c (rmt_lseek__):
2863         Convert lseek whence values to portable integers on the wire.
2864         * src/rmt.c (main): Likewise.  Check for whence values out of range.
2866         * src/create.c (finish_sparse_file): Use lseek whence macros
2867         instead of integers.
2868         * src/buffer.c (backspace_output): Likewise.
2869         * src/compare.c (diff_archive, verify_volume): Likewise.
2870         * src/delete.c (move_archive): Likewise.
2871         * src/extract.c (extract_sparse_file): Likewise.
2873         * src/create.c (dump_file): Do not invoke finish_sparse_file
2874         on a negative file descriptor.
2876         * src/buffer.c: Add braces to pacify gcc -Wall.
2878         * src/compare.c (diff_sparse_files): Report lseek errors.
2880         * configure.in (ALL_LINGUAS): Add cs, es, ru.
2882         * PORTS, TODO: gnu.ai.mit.edu -> gnu.org
2884         * src/arith.c, src/buffer.c (new_volume): Don't put ^G in
2885         message to be internationalized; \a doesn't work with msgfmt.
2887         * src/tar.c (long_options, main, usage, OPTION_STRING):
2888         Remove -E or --ending-file.
2889         * src/list.c (read_and): Likewise.
2890         * src/common.h (ending_file_option): Likewise.
2891         * src/buffer.c (close_archive): Likewise.
2893         * tests/after: Don't run two commands together in a pipeline,
2894         as some old shells mishandle pipeline exit status.
2896 1999-06-28  Paul Eggert  <eggert@twinsun.com>
2898         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64015.
2899         * NEWS: Describe changes since 1.12.
2900         * README: Update bug reporting address; move paxutils ref to NEWS.
2902         Handle EINTR correctly.
2903         * lib/Makefile.am (libtar_a_SOURCES): Add full-read.c, full-write.c.
2904         * lib/full-read.c, lib/full-write.c: New files.
2905         * src/buffer.c (child_open_for_compress, child_open_for_uncompress):
2906         Prefer full_read to read and full_write to write.
2907         * src/compare.c (process_rawdata, diff_sparse_files): Likewise.
2908         * src/create.c (deal_with_sparse, finish_sparse_file, dump_file):
2909         Likewise.
2910         * src/extract.c (extract_sparse_file): Likewise.
2911         * src/rmt.c (get_string, main, report_error_message,
2912         report_numbered_error): Likewise.
2913         * src/rmt.h (rmtread, rmtwrite): Likewise.
2914         * src/rtapelib.c (do_command, get_status_string, rmt_read__,
2915         rmt_write__, rmt_ioctl__): Likewise.
2916         * src/update.c (append_file): Likewise.
2917         * src/system.h (full_read, full_write): New decls.
2919         * po/POTFILES.in: Add lib/argmatch.c, lib/error.c lib/getopt.c,
2920         lib/xmalloc.c, src/arith.c, src/misc.c.
2922         * src/system.h (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO):
2923         New macros.  All uses of STDIN and STDOUT changed.
2924         * src/rmt.c (prepare_record_buffer, main): Use STDIN_FILENO
2925         instead of 0 and STDOUT_FILENO instead of 1.
2926         * src/rtapelib.c (_rmt_rexec): Use STDIN_FILENO and STDOUT_FILENO
2927         instead of fileno (stdin) and fileno (stdout) or 0 and 1.
2929         * src/rmt.c (private_strerror): Avoid const.  Translate results.
2931         * tests/Makefile.am (TESTS): Remove incremen.sh; it doesn't work
2932         in the presence of NFS clock skew.
2934 1999-06-25  Paul Eggert  <eggert@twinsun.com>
2936         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64014.
2938         * src/buffer.c (write_archive_buffer): New function.
2939         (child_open_for_compress, flush_write, flush_read): Use it to write
2940         buffers.
2941         (open_archive): Report error if fstat of archive fails.
2942         Improve efficiency of check for /dev/null.
2943         Also, fix some corner cases with remote archives and /dev/null checking.
2944         (close_archive): Test for input fifo only if not remote.
2945         Truncate output archive only if it's not remote.
2947         * src/misc.c (remove_any_file):
2948         Don't terminate if you see . or ..; just skip them.
2950 1999-06-18  Paul Eggert  <eggert@twinsun.com>
2952         * configure.in (AM_INIT_AUTOMAKE): version 1.12.64013.
2954         Output sizes using a format that's more compatible with
2955         traditional tar (and with GNU Emacs).
2956         * src/common.h (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT,
2957         MODE_TO_OCT, SIZE_TO_OCT, UID_TO_OCT, UINTMAX_TO_OCT):
2958         Don't subtract 1 from size.
2959         * src/create.c (to_oct): Prepend leading zeros, not spaces.
2960         Output a trailing NUL unless the value won't fit without it.
2961         (finish_header): No need to append NUL to chksum, now that
2962         to_oct is doing it.
2964 1999-06-16  Paul Eggert  <eggert@twinsun.com>
2966         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64012.
2968         * src/Makefile.am (LDADD): Link libtar.a after @INTLLIBS@, since
2969         @INTLLIBS@ might invoke rpl_realloc.
2971         * src/tar.c (backup_type): Remove decl; backupfile.h now has it.
2972         (intconv): Remove; use xstrto* fns instead.
2973         ("xstrtol.h"): Include.
2974         (check_decimal): Remove.
2975         (long_options, usage, OPTION_STRING, decode_options):
2976         Remove -y, --bzip2, --unbzip2.
2977         (decode_options): Use xget_version instead of get_version.
2978         Check for overflow with -b and -L and RECORD_SIZE_OPTION.
2979         Replace invocations of check_decimal  with xstrtoumax.
2981         * tests/preset.in (echo_n, echo_c): Remove.
2983         * tests/after: Don't rely on $echo_c and $echo_n.
2985         * lib/addext.c, lib/dirname.c, lib/lchown.c, lib/lchown.h,
2986         lib/malloc.c, lib/mktime.c, lib/realloc.c, lib/strtol.c, lib/strtoul.c,
2987         lib/strtoull.c, lib/strtoumax.c, lib/utime.c, lib/xstrtol.c,
2988         lib/xstrtol.h, lib/xstrtoul.c, lib/xstrtoumax.c,
2989         m4/Makefile.am.in, m4/README, m4/ccstdc.m4, m4/d-ino.m4,
2990         m4/gettext.m4, m4/inttypes_h.m4, m4/isc-posix.m4,
2991         m4/jm-mktime.m4, m4/largefile.m4, m4/lcmessage.m4,
2992         m4/malloc.m4, m4/progtest.m4, m4/realloc.m4, m4/uintmax_t.m4,
2993         m4/ulonglong.m4, m4/utimbuf.m4, m4/utime.m4, m4/utimes.m4,
2994         m4/xstrtoumax.m4: New files.
2996         * configure.in(fp_PROG_ECHO): Remove; no longer needed.
2997         (AC_SYS_LARGEFILE): Renamed from AC_LFS.
2998         (jm_AC_HEADER_INTTYPES_H): Replaces inline code.
2999         (jm_STRUCT_DIRENT_D_INO, jm_AC_TYPE_UINTMAX_T, jm_AC_PREREQ_XSTRTOUMAX): Add.
3000         (AC_CHECK_FUNCS): Remove lchown.
3001         (AC_REPLACE_FUNCS): Remove basename, dirname.
3002         Add lchown, strtol, strtoul.
3003         (jm_FUNC_MKTIME): Add.
3004         (LIBOBJS): Replace .o with $U.o, so that the .o files in LIBOBJS
3005         are also built via the ANSI2KNR-filtering rules.
3006         Use a no-op line to work around bug in automake 1.4 with malloc and
3007         realloc.
3008         (AC_OUTPUT): Add m4/Makefile.
3010         * lib/Makefile.am (EXTRA_DIST):
3011         Add lchown.c, malloc.c, mktime.c, realloc.c,
3012         strtol.c, strtoul.c, strtoull.c, strtoumax.c, utime.c.
3013         (noinst_HEADERS): Add lchown.h, modechange.h, xstrtol.h.
3014         (libtar_a_SOURCES): Add addext.c, basename.c, xstrtol.c,
3015         xstrtoul.c, xstrtoumax.c.  Remove getversion.c.
3016         ($(srcdir)/getdate.c:): Remove `expect conflicts' line.
3018         * src/system.h (uintmax_t): Don't declare; configure now does this.
3020         * src/common.h (backup_type): New decl.
3021         * src/common.h, src/misc.c, src/tar.c:
3022         Move include of backupfile.h to common.h.
3024         * src/misc.c (maybe_backup_file):
3025         Pass backup_type to find_backup_file_name.
3027         * src/list.c (print_header): Change sizes of uform and gform from 11 to
3028         UINTMAX_STRSIZE_BOUND.
3030         * doc/tar.texi: Remove --bzip2.
3031         Fix @xref typos reported by latest makeinfo.
3033         * Makefile.am (ACLOCAL_AMFLAGS): New macro.
3034         (SUBDIRS): Add m4.
3035         (M4DIR, ACINCLUDE_INPUTS): New macros.
3036         ($(srcdir)/acinclude.m4): New rule.
3038         * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT,
3039         HAVE_INTTYPES_H, HAVE_LC_MESSAGES, HAVE_STPCPY): Remve #undefs;
3040         now generated automatically by autoconf.
3042 1999-05-15  Paul Eggert  <eggert@twinsun.com>
3044         * doc/tar.texi: Remove -y.
3046 1999-04-09  Paul Eggert  <eggert@twinsun.com>
3048         * src/system.h (INT_STRLEN_BOUND): Fix off-by-factor-of-10 typo
3049         (we were allocating too much storage).
3050         (uintmax_t): Don't declare; configure now does this.
3052         * ABOUT-NLS: Update to gettext 0.10.35 edition.
3054 1999-03-22  Paul Eggert  <eggert@twinsun.com>
3056         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64010
3058         * acinclude.m4 (AC_LFS_FLAGS):
3059         Don't use -mabi=n32 with GCC on IRIX 6.2; it's the default.
3060         (AC_LFS): -n32, -o32, and -n64 are CPPFLAGS, not CFLAGS.
3061         (jm_FUNC_MALLOC, jm_FUNC_REALLOC): New macros.
3063         * configure.in (jm_FUNC_MALLOC, jm_FUNC_REALLOC):
3064         New macros; needed for latest GNU xmalloc.c.
3066         * Makefile.am (noinst_HEADERS): Add quotearg.h, xalloc.h.
3067         (libtar_a_SOURCES): Add quotearg.c.
3068         * list.c: Include <quotearg.h>.
3069         (from_oct): Add forward decl.
3070         (read_header): Return HEADER_FAILURE if we can't parse the checksum.
3071         (from_oct): Report an error only if TYPE is nonzero.
3072         Quote any funny characters in bad header.
3074 1999-03-20  Paul Eggert  <eggert@twinsun.com>
3076         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64009
3078         * acinclude.m4 (AC_LFS_FLAGS): Add support for IRIX 6.2 and later.
3079         (AC_LFS_SPACE_APPEND): Assume $2 is quoted properly; all callers
3080         changed.
3081         (AC_LFS): Simplify AIX revision number test.
3083 1999-03-17  Paul Eggert  <eggert@twinsun.com>
3085         * NEWS, configure.in (AM_INIT_AUTOMAKE): version 1.12.64008
3087         * configure.in (AC_VALIDATE_CACHED_SYSTEM_TUPLE):
3088         Remove; it doesn't work that well
3089         with AC_CANONICAL_HOST.
3090         (fp_WITH_INCLUDED_MALLOC): Remove; we'll just use the system malloc.
3092         * Makefile.am (EXTRA_DIST): Remove AC-PATCHES, AM-PATCHES, BI-PATCHES.
3094         * Makefile.am (EXTRA_DIST): Remove gmalloc.c.
3096         * acinclude.m4 (fp_WITH_INCLUDED_MALLOC): Remove.
3098         * tar.texi: Fix bug-report addr.
3100         * README: Remove --with-included-malloc.
3101         Upgrade version numbers of build software.
3103 1999-03-07  Paul Eggert  <eggert@twinsun.com>
3105         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64007.
3107         * acinclude.m4 (AM_WITH_NLS): Port to Solaris 2.5.1,
3108         where bindtextdomain and gettext require -lintl.
3109         (AC_LFS_FLAGS): Simplify so that it only gets the flags;
3110         `no' means it failed.
3111         (AC_LFS_SPACE_APPEND, AC_LFS_MACRO_VALUE): New macros.
3112         (AC_LFS): Use them.  Set _FILE_OFFSET_BITS, _LARGEFILE_SOURCE, and
3113         _LARGE_FILES from LFS_CFLAGS, so that in the normal case we don't need
3114         to add anything to the command line (it's all in config.h).
3115         Put any extra -D and -I options into CPPFLAGS, the rest into CFLAGS.
3117 1999-03-01  Paul Eggert  <eggert@twinsun.com>
3119         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64006.
3121         * acinclude.m4 (AC_LFS_FLAGS): Port to AIX 4.2.
3123         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
3124         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
3125         uid_from_oct, uintmax_from_oct): Use TYPE_MAXIMUM instead of macros
3126         like OFF_MAX, which are not reliable
3127         (e.g. OFF_MAX in AIX 4.2 is incorrect).
3128         * src/system.h (GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX, OFF_MAX,
3129         SIZE_MAX, TIME_MAX,UID_MAX, UINTMAX_MAX):  Remove; no longer used.
3131         * src/incremen.c (get_directory_contents):
3132         Don't use statx if _LARGE_FILES; it doesn't work under AIX 4.2.
3133         Have statx depend on STX_HIDDEN, not AIX.
3135         * src/create.c (to_oct):
3136         New parameter substitute, giving a substitute value to use
3137         when the original value is out of range.  Do not append a space to the
3138         output; modern tars don't.  When a value is out of range, specify the
3139         maximum value, not the number of bits.
3140         (GID_NOBODY, UID_NOBODY): New macros.
3141         (gid_to_oct, uid_to_oct): Use them as substitutes.
3142         (finish_header): Do not assume that UINTMAX_TO_OCT appends a space.
3143         (dump_file): Check whether the file changed as we read it.
3145         * src/rmt.c (main): Remove suspicious AIX/386 code.
3147 1999-02-19  Paul Eggert  <eggert@twinsun.com>
3149         * intl/localealias.c (read_alias_file): Don't assume that memcpy
3150         returns a type compatible with char *; it doesn't on SunOS
3151         4.1.4 with Sun cc, since <string.h> doesn't declare memcpy.
3153         * NEWS, configure.in (AM_INIT_AUTOMAKE): Version 1.12.64005.
3155         * src/tar.c (long_options, usage): Prefer --unbzip2 to --bunzip2.
3156         * doc/tar.texi: Add --bzip2, --unbzip2 options.
3158         * configure.in (AC_CANONICAL_HOST, AC_VALIDATE_CACHED_SYSTEM_TUPLE):
3159         Add.
3160         (AC_LINK_FILES): Omit; AM_GNU_GETTEXT now does this.
3161         (AC_OUTPUT): Omit munging of po/Makefile; AM_GNU_GETTEXT now does this.
3162         * acinclude.m4 (AM_WITH_NLS):
3163         Update to latest gettext version (serial 5).
3164         (AC_LFS_FLAGS): New macro
3165         (AC_LFS): Use it.  Append to CFLAGS, LDFLAGS, LDLIBS instead of
3166         working only with unset variables.  Append to CFLAGS, not CPPFLAGS.
3167         Work properly in cross-compilation scenario, by checking for getconf
3168         with AC_CHECK_TOOL and by ditching uname in favor of
3169         AC_CANONICAL_HOST and $host_os.  Add --disable-lfs option.
3171         * lib/getdate.y: Update to fileutils 4.0 getdate.y, with one patch:
3172         replace FORCE_ALLOCA_H with HAVE_ALLOCA_H.
3173         * lib/Makefile.am (AUTOMAKE_OPTIONS): Append ../src/ansi2knr,
3174         since getdate.y now uses ANSI code.
3176         * config.guess, config.sub: New files; taken from automake 1.4.
3178         * intl/Makefile.in, intl/VERSION, intl/bindtextdom.c,
3179         intl/cat-compat.c, intl/dcgettext.c, intl/dgettext.c,
3180         intl/explodename.c, intl/finddomain.c, intl/gettext.c,
3181         intl/gettext.h, intl/gettextP.h, intl/hash-string.h,
3182         intl/l10nflist.c, intl/libgettext.h, intl/loadinfo.h,
3183         intl/loadmsgcat.c, intl/localealias.c, intl/textdomain.c:
3184         Update to GNU gettext 0.10.35, with patches as per GCC snapshot 990109.
3186 1999-02-01  Paul Eggert  <eggert@twinsun.com>
3188         * src/tar.c: Update copyright.
3190         * NEWS: 1.12.64004
3192 1999-02-01  Paul Eggert  <eggert@twinsun.com>
3194         * NEWS, configure.in: Version 1.12.64004
3196         * configure.in (AC_LFS): Use this macro, instead of open-coding it.
3198         * acinclude.m4 (AC_LFS, AM_PROG_CC_STDC): New macros.
3200         * src/extract.c (extract_archive): Fix bug when extracting sparse
3201         files: they were trashing the tar file header.
3203         * src/tar.c: (long_options, usage, OPTION_STRING, decode_options):
3204         Add -y or --bzip2 or --bunzip2 option.
3206 1999-01-30  Paul Eggert  <eggert@twinsun.com>
3208         * src/names.c (cached_no_such_uname, cached_no_such_gname,
3209         cached_no_such_uid, cached_no_such_gid): New vars.
3210         (uid_to_uname, gid_to_gname, uname_to_uid, gname_to_gid):
3211         Cache failures, too.
3213         * src/tar.c (decode_options):
3214         Don't pass names longer than UNAME_FIELD_SIZE to
3215         uname_to_uid, as it messes up the cache.  Similarly for gname_to_uid.
3217 1999-01-27  Paul Eggert  <eggert@twinsun.com>
3219         * NEWS, configure.in: Version 1.12.64003
3221         * src/buffer.c (backspace_output, close_archive):  Cast
3222         rmtlseek position arg to off_t, for benefit of K&R compilers
3223         with long long.
3224         * src/compare.c (verify_volume): Likewise.
3226         * NEWS, configure.in: Version 1.12.64002
3228         * src/create.c (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct,
3229         off_to_oct, size_to_oct, time_to_oct, uid_to_oct):
3230         Cast arg to uintmax_t for benefit of pre-ANSI compilers with long long.
3231         * src/list.c: (gid_from_oct, major_from_oct, minor_from_oct,
3232         mode_from_oct, off_from_oct, size_from_oct, time_from_oct,
3233         uid_from_oct): Likewise.
3235 1999-01-25  Paul Eggert  <eggert@twinsun.com>
3237         * incremen.sh: Fix timing bug in regression test.
3239 1999-01-22  Paul Eggert  <eggert@twinsun.com>
3241         * NEWS, configure.in: Update version
3243         * Makefile.am (localedir): Change to $(datadir)/locale.
3244         (DEFS): New macro, defining LOCALEDIR.
3245         (tar.o, tar._o, rmt.o, rmt._o): Remove.
3246         (INCLUDES): Add -I..
3248         * Makefile.am (localedir): Change to $(datadir)/locale.
3250 1999-01-21  Paul Eggert  <eggert@twinsun.com>
3252         * NEWS, README, configure.in: Unofficial version 1.12.64001.
3254         * tests/Makefile.am (localedir): Change to $(datadir)/locale.
3255         * src/Makefile.am (localedir): Likewise.
3256         (DEFS): New macro, defining LOCALEDIR.
3257         (tar.o, tar._o, rmt.o, rmt._o): Remove.
3258         (INCLUDES): Add `-I..'.
3260         * tests/incremen.sh: Fix timing bug.
3262 1999-01-20  Paul Eggert  <eggert@twinsun.com>
3264         * NEWS, README, configure.in: Unofficial version 1.12.64000.
3265         `lfs.7' changed to `64000' in version number
3266         to conform to gnits standards.
3268         * COPYING, INSTALL, doc/texinfo.tex, install-sh, missing,
3269         mkinstalldirs, ansi2knr.c: Update to latest public versions.
3271         Rebuild with automake 1.4 and autoconf 2.13, to work around some
3272         porting problems.
3274 1998-12-07  Paul Eggert  <eggert@twinsun.com>
3276         * NEWS, README, configure.in: Unofficial version 1.12.lfs.6.
3278         * src/list.c (read_header):
3279         Accept file names as specified by POSIX.1-1996 section 10.1.1.
3281 1998-11-30  Paul Eggert  <eggert@twinsun.com>
3283         * configure.in: Quote the output of uname.
3285         * src/extract.c (set_stat): chmod after chown even when not root;
3286         if we are using --same-owner this is needed e.g. on Solaris 2.5.1.
3288 1998-11-15  Paul Eggert  <eggert@twinsun.com>
3290         * NEWS, README, configure.in: Unofficial version 1.12.lfs.5.
3292         * configure.in (ac_test_CPPFLAGS, ac_test_LDFLAGS, ac_test_LIBS,
3293         ac_getconfs, ac_result): Special case for HP-UX 10.20 or later.
3295 1998-10-28  Paul Eggert  <eggert@twinsun.com>
3297         * NEWS, README, configure.in: Unofficial version 1.12.lfs.4.
3299         * src/system.h (voidstar): Use void * if __STDC__ is defined,
3300         not merely nonzero.
3302         * src/rtapelib.c: Don't use rexec code unless compiled with WITH_REXEC.
3303         On many installations, rexec is disabled.
3305 1998-08-07  Paul Eggert  <eggert@twinsun.com>
3307         * NEWS, README, configure.in: Unofficial version 1.12.lfs.3.
3309         * src/names.c (uid_to_uname, gid_to_gname): Don't used cached name
3310         for nameless users and groups.
3312 1998-02-17  Paul Eggert  <eggert@twinsun.com>
3314         * NEWS, README, configure.in: Unofficial version 1.12.lfs.2.
3315         * NEWS, README: Add explanation of why this isn't an official version.
3317 1998-02-02  Paul Eggert  <eggert@twinsun.com>
3319         * NEWS, README, configure.in: Unofficial version 1.12.lfs.1.
3320         This is an unofficial version.
3322 1997-12-17  Paul Eggert  <eggert@twinsun.com>
3324         * src/incremen.c (ST_DEV_MSB): New macro.
3325         (NFS_FILE_STAT): Use most significant bit of st_dev,
3326         even if it's unsigned.
3328 1997-12-08  Paul Eggert  <eggert@twinsun.com>
3330         * src/system.h (ST_NBLOCKS): Fix typo in definition.
3332 1997-11-19  Paul Eggert  <eggert@twinsun.com>
3334         * configure.in (HAVE_INTTYPES_H):
3335         Don't ignore cache variable if it's already set.
3337 1997-11-10  Paul Eggert  <eggert@twinsun.com>
3339         * src/rmt.c (main): Don't assume mt_count is of type daddr_t.
3340         * src/delete.c (records_read): Now off_t.
3341         (move_archive): Don't assume mt_count is of type daddr_t.
3343 1997-10-30  Paul Eggert  <eggert@twinsun.com>
3345         * configure.in (CPPFLAGS, LDFLAGS, LIBS):
3346         Set to appropriate values if large file support
3347         needs explicit enabling.
3348         (HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING, daddr_t, major_t, minor_t,
3349         ssize_t):
3350         New macros to configure.
3351         (AC_TYPE_MODE_T, AC_TYPE_PID_T, AC_TYPE_OFF_T): Add.
3353         * acconfig.h (daddr_t, HAVE_INTTYPES_H, HAVE_ST_FSTYPE_STRING,
3354         major_t, minor_t, ssize_t): New macros.
3356         * src/arith.h (TARLONG_FORMAT):
3357         Fix typo: %uld -> %lu.  Use unsigned when long long
3358         (%lld -> %llu).
3359         (add_to_tarlong_helper, mult_tarlong_helper): 2nd arg is now unsigned long.
3360         (add_to_tarlong, mult_tarlong): Cast 2nd arg to unsigned long.
3362         * src/arith.c (add_to_tarlong_helper, mult_tarlong_helper):
3363         2nd arg is now unsigned long.
3365         * src/rmt.c (allocated_size): Now size_t, and now initialized to 0.
3366         (prepare_record_buffer): Arg is now size_t.
3367         Remove now-useless casts.
3369         (main): Use `long' for status, so that it can store ssize_t.
3370         Use daddr_t, mode_t, size_t, off_t when appropriate.
3371         Convert daddr_t and off_t values ourselves, since they might be longer
3372         than long.  Convert other types using `long' primitives.
3373         When processing MTIOCTOP, do not try to pass resulting
3374         count back, since it won't work (it could be too large) and it's
3375         not expected anyway.
3377         * src/update.c:
3378         (append_file) Use off_t, size_t, ssize_t when appropriate.  Remove
3379         now-useless casts.  Use unsigned long to print *_t types, except use
3380         STRINGIFY_BIGINT for off_t.
3381         (update_archive): Cast -1 to dev_t when necessary.
3383         * src/tar.c (check_decimal):
3384         Now returns 1 if successful, 0 otherwise, and returns
3385         uintmax_t value into new arg.  Check for arithmetic overflow.
3386         (decode_options): Avoid overflow if record_size fits in size_t but not int.
3387         Check for overflow on user or group ids.
3389         * src/compare.c (diff_init, process_rawdata, read_and_process,
3390         diff_sparse_files, diff_archive):
3391         Use off_t, pid_t, size_t, ssize_t when appropriate.
3392         Remove now-useless casts.  Use unsigned long to print *_t types,
3393         except use STRINGIFY_BIGINT for off_t.
3395         (process_noop, process_rawdata, process_dumpdir, read_and_process):
3396         Size arg is now size_t.
3398         (diff_sparse_files): Arg is now off_t.  Check for size_t overflow
3399         when allocating buffer.
3401         * src/rtapelib.c:
3402         (do_command, rmt_open__, rmt_read__, rmt_lseek__, rmt_ioctl__):
3403         Use pid_t, size_t, ssize_t when appropriate.  Remove now-useless casts.
3404         Use unsigned long to print *_t types, except use STRINGIFY_BIGINT for
3405         off_t.
3407         (get_status_string, get_status_off): New function.
3408         (get_status): Now returns long, so that it can store ssize_t.
3409         Invoke get_status_string to do the real work.
3410         (rmt_read__, rmt_write__): Now returns ssize_t. Size arg is now size_t.
3411         (rmt_lseek__): Now returns off_t, using new get_status_off function.
3412         (rmt_ioctl__): Convert mt_count by hand,
3413         since it might be longer than long.
3415         * src/mangle.c (extract_mangle):
3416         Check for overflow when converting off_t to size_t.
3417         Use off_t, size_t when appropriate.  Remove now-useless casts.
3419         * src/system.h (mode_t): Remove; now done by autoconf.
3420         (ST_NBLOCKS): Do not overflow if st_size is near maximum.
3421         Return number of ST_NBLOCKSIZE-byte blocks,
3422         not number of 512-byte blocks;
3423         this also helps to avoid overflow.
3424         (st_blocks): Declare if needed.
3425         (ST_NBLOCKSIZE): New macro.
3426         (<limits.h>, <inttypes.h>): Include if available.
3427         (CHAR_BIT): New macro.
3428         (uintmax_t): New typedef.
3429         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND,
3430         UINTMAX_STRSIZE_BOUND, GID_MAX, MAJOR_MAX, MINOR_MAX, MODE_MAX,
3431         OFF_MAX, SIZE_MAX, TIME_MAX, UID_MAX, UINTMAX_MAX): New macros.
3433         * src/names.c (name_init):
3434         Fix typo in error message: FILE* was passed, but char*
3435         was wanted.
3437         (read_name_from_file, name_gather, addname, name_match, name_scan,
3438         add_exclude): Use size_t when appropriate.  Remove now-useless casts.
3440         (exclude_pool_size, allocated_exclude_pool_size): Now size_t.
3442         * src/extract.c (newdir_umask, current_umask): Now mode_t.
3443         (extract_sparse_file): Args now use off_t.
3445         (set_mode, set_stat, make_directories, extract_sparse_file,
3446         extract_archive): Use off_t, size_t, ssize_t when appropriate.  Remove
3447         now-useless casts.  Use unsigned long to print *_t types, except use
3448         STRINGIFY_BIGINT for off_t.
3450         * src/misc.c (quote_copy_string):
3451         Use size_t when appropriate.  Remove now-useless casts.
3453         * src/list.c (read_and, list_archive, read_header, decode_mode,
3454         print_header, print_for_mkdir):
3455         Use mode_t, off_t, size_t when appropriate.  Remove
3456         now-useless casts.  Use unsigned long to print *_t types, except use
3457         STRINGIFY_BIGINT for off_t.
3459         (read_header): Check for overflow when converting header size.
3461         (from_oct): Now static.  Now returns uintmax_t.  `where' arg is now
3462         const char *.  Size arg is now size_t.  Now takes new type and maxval
3463         args.  Compute result using uintmax_t, not long.  Report error if
3464         field does not contain octal number in range.
3465         (gid_from_oct, major_from_oct, minor_from_oct, mode_from_oct,
3466         off_from_oct, size_from_oct, time_from_oct, uid_from_oct,
3467         uintmax_from_oct): New functions.
3469         (stringify_uintmax_t_backwards): New function.
3471         (decode_mode, print_for_mkdir): Mode arg is now mode_t.
3472         (skip_file): Offset arg is now off_t.
3474         * src/buffer.c (record_start_block, save_totsize, save_sizeleft,
3475         real_s_totsize, real_s_sizeleft, current_block_ordinal):
3476         Now off_t.
3477         (write_error): Arg is now ssize_t.
3478         (child_pid): Now pid_t.
3479         (available_space_after): Now size_t.
3481         (child_open_for_compress, child_open_for_uncompress, flush_write,
3482         open_archive, flush_write, write_error, flush_read, close_archive):
3483         Use pid_t, ssize_t, size_t when appropriate.  Remove now-useless
3484         casts.  Use unsigned long to print *_t types, except use
3485         STRINGIFY_BIGINT for off_t.
3487         * src/delete.c (records_read): Now daddr_t.
3488         (move_archive): Arg is now daddr_t.  Check for overflow when
3489         computing offset.
3490         (move_archive, delete_archive_members): Use daddr_t, off_t when
3491         appropriate.  Remove now-useless casts.
3493         * src/rmt.h (rmt_read__, rmt_write__): Now returns ssize_t.
3494         (rmt_lseek): Now returns off_t.
3496         * src/create.c (to_oct):
3497         Now static.  Value arg is now uintmax_t.  Accept new args
3498         giving name of type of octal field, for error messages.  Report an
3499         error if the value is too large to fit in the field.
3500         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
3501         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct): New functions.
3503         (write_eot, write_long, finish_header, deal_with_sparse,
3504         finish_sparse_file, dump_file): Use dev_t, off_t, ssize_t, size_t when
3505         appropriate.  Remove now-useless casts.  Use unsigned long to print
3506         *_t types, except use STRINGIFY_BIGINT for off_t.
3508         (find_new_file_size): 1st arg is now off_t*.
3509         (finish_sparse_file): Args now use off_t, not long.
3510         Check for lseek error.
3511         (create_archive, dump_file): Cast -1 to dev_t when necessary.
3512         (dump_file): Device arg is now dev_t.
3513         Avoid overflow when testing whether file has holes
3514         by using the new ST_NBLOCKSIZE macro.
3516         * src/incremen.c (struct accumulator, add_to_accumulator,
3517         get_directory_contents, add_hierarchy_to_namelist, gnu_restore):
3518         Use size_t for sizes.
3519         (struct directory, get_directory_contents, add_hierarchy_to_namelist):
3520         Use dev_t, ino_t for devices and inodes.
3521         (gnu_restore): Use off_t for file offsets.
3522         (struct directory): Use char for flags.  Add new flag `nfs'.
3523         (nfs): New constant
3524         (NFS_FILE_STAT): New macro.
3525         (note_directory): Accept struct stat * instead of
3526         device and inode number.  All callers changed.
3527         (note_directory, get_directory_contents):
3528         Use NFS_FILE_STAT to determine whether directory is an NFS directory.
3529         (write_dir_file): Cast time_t to unsigned long before printing as %lu.
3531         * src/common.h (record_size, struct name, struct sp_array,
3532         available_space_after):
3533         Use size_t for sizes.
3534         (save_sizeleft, save_totsize, current_block_ordinal, skip_file):
3535         Use off_t for file offsets.
3536         (struct name): dir_contents is now const char *, not char *.
3537         (dump_file, get_directory_contents): Use dev_t for devices.
3538         (to_oct): Remove decl.
3539         (GID_TO_OCT, MAJOR_TO_OCT, MINOR_TO_OCT, MODE_TO_OCT, SIZE_TO_OCT,
3540         UID_TO_OCT, UINTMAX_TO_OCT, OFF_TO_OCT, TIME_TO_OCT, STRINGIFY_BIGINT,
3541         GID_FROM_OCT, MAJOR_FROM_OCT, MINOR_FROM_OCT, MODE_FROM_OCT,
3542         OFF_FROM_OCT, SIZE_FROM_OCT, TIME_FROM_OCT, UID_FROM_OCT,
3543         UINTMAX_FROM_OCT): New macros.
3544         (gid_to_oct, major_to_oct, minor_to_oct, mode_to_oct, off_to_oct,
3545         size_to_oct, time_to_oct, uid_to_oct, uintmax_to_oct,
3546         stringify_uintmax_t_backwards, gid_from_oct, major_from_oct,
3547         minor_from_oct, mode_from_oct, off_from_oct, size_from_oct,
3548         time_from_oct, uid_from_oct, uintmax_from_oct): New decls.
3549         (print_for_mkdir): 2nd arg is now mode_t.
3551 See ChangeLog.1 for earlier changes.
3554 Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
3556 This file is part of GNU tar.
3558 GNU tar is free software; you can redistribute it and/or modify
3559 it under the terms of the GNU General Public License as published by
3560 the Free Software Foundation; either version 2, or (at your option)
3561 any later version.
3563 GNU tar is distributed in the hope that it will be useful,
3564 but WITHOUT ANY WARRANTY; without even the implied warranty of
3565 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3566 GNU General Public License for more details.
3568 You should have received a copy of the GNU General Public License
3569 along with GNU tar; see the file COPYING.  If not, write to
3570 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3571 Boston, MA 02111-1307, USA.