Commit Graph

586 Commits

Author SHA1 Message Date
Paul Eggert
bc8d000b64 (read_and):
Do not invoke apply_nonancestor_delayed_set_stat;
DO_SOMETHING is now responsible for that.
Do not invoke apply_delayed_set_stat; our caller is now responsible for that.
(read_header): Use signed char instead of signed_char.
Prevent later references to current_header from
mistakenly treating it as an old GNU header.
(from_header): Quote invalid base-64 strings in diagnostics.
(time_from_header): Do not warn about future timestamps in archive;
check_time now does that.
(tartime): Fix off-by-one error when copying year if OLD_CTIME.
(print_header): Quote unknown file types.
(skip_member): New function, replacing skip_extended_headers and
now skipping the whole member instead of just the extended headers.
All callers changed.  This makes the code handle extended headers
uniformly, and fixes some bugs.
2000-10-24 06:18:37 +00:00
Paul Eggert
5156a90a1e (full_write): Some buggy drivers return 0 when you
fall off a device's end.  Detect this.
2000-10-24 06:18:37 +00:00
Paul Eggert
8d8a85f9a2 (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
2000-10-24 06:18:37 +00:00
Paul Eggert
8a098729c0 (extract_mangle): Fix diagnostic with wrong number of %s'es. 2000-10-24 06:18:37 +00:00
Paul Eggert
257a4160e4 (base_name): Do not include basename.h; declare base_name
instead.
(rexec): Don't declare unless using it.
(do_command): Simplify signal-handling code slightly.
2000-10-24 06:18:37 +00:00
Paul Eggert
4dcebd9655 (_GNU_SOURCE): Remove; autoconf now does this.
(child_open_for_compress, child_open_for_uncompress, close_archive):
Propagate any failure of the compression process back to "tar".
(open_archive, flush_write, flush_read, close_archive):
Do not allocate an array of size PATH_MAX, as PATH_MAX might be (size_t) -1.
Instead, allocate an array with the size that's needed.
(open_archive): Don't bother checking S_ISCHR of /dev/null.
(backspace_output): Don't try to backspace past start of archive.
(close_archive): Remove special case for DELETE_SUBCOMMAND.
2000-10-24 06:18:37 +00:00
Paul Eggert
8c308d8315 (EXTRA_DIST): Add decl.m4, error.m4, mbstate_t.m4, prereq.m4.
Remove signedchar.m4.
2000-10-24 06:18:37 +00:00
Paul Eggert
a6f11d4092 (AC_FUNC_MATCH): Detect d*/*1 vs d/s/1 bug. 2000-10-24 06:18:37 +00:00
Paul Eggert
85e724550f (_GNU_SOURCE): Remove; autoconf now does this.
Include <hash.h>.
(getpwuid, getgrgid): Declare only if system headers don't.
(gid_to_gname): Don't invoke setgrent.
(namelist): Now static, not global.
(nametail): New var.  All uses of namelast changed to use nametail,
with one extra level of indirection.
(name_gather): Use memcpy instead of strncpy + assignment of NUL.
(name_match): Set nametail too, when setting namelist to null.
(add_hierarchy_to_namelist): Change type of dir arg from char * to
struct name *, so that we don't have to look up the name again here.
Get change_dir from dir rather than as a separate arg.  Add dirsize arg,
and pass it along to get_directory_contents.  Remove unnecessary check
of directory type.
(new_name): Do not append a slash if PATH already ends in one.
(avoided_names, struct avoided_name): Remove.
(avoided_name_table): New var, replacing avoided_names.
(hash_avoided_name, compare_avoided_names): New function.
(add_avoided_name, is_avoided_name): Use hash table rather than linked list.
2000-10-24 06:18:37 +00:00
Paul Eggert
b20005e951 Mention the GNU C library. 2000-10-20 17:33:17 +00:00
Paul Eggert
2473f7fad6 Add a couple more test cases to catch bugs in glibc 2.1.95. 2000-10-20 05:27:04 +00:00
Paul Eggert
8caec82653 (<limits.h>): Include if HAVE_LIMITS_H.
(CHAR_BIT): Define if not defined.
2000-10-17 17:20:55 +00:00
Paul Eggert
9d290bf45e (<limits.h>): Do not include; human.h does it if needed.
(CHAR_BIT): Remove.
2000-10-17 17:20:55 +00:00
Paul Eggert
5ed9bdbf57 Initial revision 2000-09-09 15:57:28 +00:00
Paul Eggert
c86c626f04 Memory exhausted -> memory exhausted 2000-08-07 16:46:16 +00:00
Paul Eggert
9a742c498f (xalloc_msg_memory_exhausted): change to array from char *. 2000-08-07 16:02:21 +00:00
Paul Eggert
54278395ab Define mbstate_t to be int, not char, for compatibility with glibc
2.1.3 strftime.c.
2000-08-07 04:27:00 +00:00
Paul Eggert
1063141801 Simplify exhausted message. 2000-07-15 05:53:00 +00:00
Paul Eggert
cf4b8601b4 (AC_MBSTATE_T): Renamed from AC_MBSTATE_T_OBJECT. All uses changed.
Change from a two-part test, which defines both HAVE_MBSTATE_T_OBJECT
and mbstate_t, to a single-part test that simply defines mbstate_t.
2000-07-11 03:55:28 +00:00
Paul Eggert
f03a9c9335 fileutils 4.0x 2000-07-09 07:25:03 +00:00
Paul Eggert
a70cec699f Initial revision 2000-07-09 07:25:03 +00:00
Paul Eggert
12d0cc62bb (AC_MBSTATE_T_OBJECT): Test for mbstate_t only if the test
for an object-type mbstate_t fails.
2000-07-05 18:41:17 +00:00
Paul Eggert
73266a46f3 (AC_MBSTATE_T_OBJECT): Port to autoconf 2.13.
Add AC_CHECK_HEADERS(stdlib.h), since we use HAVE_STDLIB_H.
2000-07-03 22:04:18 +00:00
Paul Eggert
865e5f3295 textutils 2.0f 2000-07-02 20:04:14 +00:00
Paul Eggert
f996454418 (<unistd.h>): Do not include; there's no need.
(NAMLEN): Remove macro.
(malloc, realloc): Remove decls.
(stpcpy): Likewise.
("xalloc.h"): Include.
(NAME_SIZE_DEFAULT): New macro.
(savedir): Use xmalloc / xrealloc to allocate memory.
Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
Skip "" directory entries.
Use strlen to calculate directory entry length, since the old method
is rarely used these days and isn't worth supporting.
Check for integer overflow when calculating allocation size.
Use memcpy to copy entries, instead of stpcpy.
Set errno properly when returning NULL.
Check for readdir error.
2000-06-26 23:25:37 +00:00
Paul Eggert
ee21d9f1e3 Include stdio.h before wchar.h, to work around a bug
in glibc 2.1.3.
2000-06-26 18:53:06 +00:00
Paul Eggert
b0a7ff33fd Fix inaccorate comment for xrealloc. 2000-06-26 18:46:37 +00:00
Paul Eggert
c61d0787ce (adjust_value): New function.
(human_readable_inexact): Apply rounding style even when printing
approximate values.
2000-06-15 18:11:13 +00:00
Paul Eggert
c9dfa7a7e8 Avoid shadowing warnings.
From: Jim Meyering <meyering@ascend.com>
Date: 15 Jun 2000 14:40:00 +0200
2000-06-15 15:47:43 +00:00
Paul Eggert
bff9056e88 White space changes, to match fileutils. 2000-06-15 12:51:56 +00:00
Paul Eggert
e1c9c92abd (human_readable_inexact): Allow an input block size that is not a
multiple of the output block size, and vice versa.
2000-06-15 01:40:09 +00:00
Paul Eggert
44579f77cf (get_date): Apply relative times after time zone indicator, not
before.
2000-06-14 17:57:26 +00:00
Paul Eggert
addd73b34a Initial revision 2000-06-08 20:17:44 +00:00
Paul Eggert
74497f7010 glibc snapshot 2000-05-24 20:08:51 +00:00
Paul Eggert
0b9f42e41a Initial revision 2000-04-19 00:38:49 +00:00
Paul Eggert
a9d7ae22a8 Initial revision 2000-02-27 17:52:01 +00:00
Paul Eggert
977e420a35 (savedir): Work even if directory size is negative; this can
happen with some NFS screwups.
2000-02-24 00:15:00 +00:00
Paul Eggert
3a19b8b0df Handle two-digit years with leading zeros correctly.
(textint): New typedef.
(parser_control): Changed from struct parser_control to typedef (for
consistency).  Member year changed from int to textint.  All uses changed.
(YYSTYPE): Removed; replaced by %union with int and textint members.
(tID): Removed; not used.
(tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
(tSNUMBER, tUNUMBER): Now of type <textintval>.
(date, number, to_year): Use width of number in digits, not its value,
to determine whether it's a 2-digit year, or a 2-digit time.
(yylex): Store number of digits of numeric tokens.
Return '?' for unknown identifiers, rather than (unused) tID.
2000-02-19 00:25:54 +00:00
Paul Eggert
19209ceaf7 sh-utils-2.0f 2000-01-22 14:23:13 +00:00
Paul Eggert
8d5417b2ef From Meyering 2000-01-19 14:00:07 +00:00
Paul Eggert
54bb77bfca Initial revision 2000-01-17 06:23:01 +00:00
Paul Eggert
619c6ea42f Change quoting to be compatible with future autoconf versions. 2000-01-16 04:45:26 +00:00
Paul Eggert
ba2ef4d075 Update copyright year. 2000-01-07 23:02:32 +00:00
Paul Eggert
e1fba9a30b 1.13.17 news 2000-01-07 23:02:32 +00:00
Paul Eggert
40e03ba28d Update copyright. 2000-01-07 22:31:23 +00:00
Paul Eggert
c18999bad5 (read_and): Invoke apply_nonancestor_delayed_set_stat on file names
after handling them.
(list_archive): Use consistent message for unexpected EOF.
Use error message functions to report errors consistently.
(read_header): Use xalloc_die to report memory exhaustion.
Use consistent message for unexpected EOF.
(decode_mode): Remove; moved to misc.c.
(skip_file): Use consistent message for unexpected EOF.
(skip_extended_headers): Likewise.
2000-01-07 19:25:23 +00:00
Paul Eggert
f74454cb37 (find_new_file_size): Return size instead of storing through pointer.
All callers changed.
(deal_with_sparse): Don't keep reading after read errors.
(finish_sparse_file): Just abort if there is an internal error.
Use error message functions to report errors consistently.
(dump_file): Fix typo: stat_warn and stat_error were interchanged.
Quote file names with colons if possible.
Don't restore access times on directories during incremental dumps
until after dealing with the directory.
If ignoring failed reads, count closedir errors as warnings, not errors.
Fix buffer overrun problem when dumping sparse files.
If ignoring failed reads, count read errors as warnings, not errors.
Use error message functions to report errors consistently.
If ignoring failed reads, count unknown files as warnings, not errors.
2000-01-07 19:25:23 +00:00
Paul Eggert
f2b8b4a42d (extract_mangle): Use xalloc_die to report memory exhaustion.
Quote file names with colons if possible.
2000-01-07 19:25:23 +00:00
Paul Eggert
53f16a5971 (extr_init): If we run out of memory, invoke apply_delayed_set_stat.
(set_mode): Use Use error message functions to report errors consistently.
(set_stat): Likewise.
(repair_delayed_set_stat): Quote file names with colons if possible.
(prepare_to_extract): Don't complain if we can't remove ".".
(extract_sparse_file): Use consistent message for unexpected EOF.
Use error message functions to report errors consistently.
(extract_archive): Use consistent message for unexpected EOF.
Use error message functions to report errors consistently.
Quote file names with colons if possible.
(apply_delayed_set_stat): New function.
(apply_nonancestor_delayed_set_stat): Renamed from apply_delayed_set_stat.
Don't remove head if it doesn't apply.
(fatal_exit): Invoke apply_delayed_set_stat with no args.
2000-01-07 19:25:23 +00:00
Paul Eggert
c598438dd2 (decode_options): Use xalloc_die to report memory exhaustion.
--delete and -f - are now incompatible, since we didn't have time
to fix their bugs.
2000-01-07 19:25:23 +00:00