Commit Graph

48 Commits

Author SHA1 Message Date
Sergey Poznyakoff
549a691ada Replace strdup with xstrdup 2005-02-15 15:24:35 +00:00
Sergey Poznyakoff
937202acb9 (name_file): Removed variable.
(read_name_from_file): Removed function. All callers changed.
(name_close): Removed function. All callers changed.
2005-01-18 01:11:56 +00:00
Sergey Poznyakoff
7347b4f5d5 Started merging with cpio into paxutils. 2004-09-06 14:28:55 +00:00
Sergey Poznyakoff
d14f101217 (register_individual_file,is_individual_file): New functions. 2004-09-01 15:05:28 +00:00
Sergey Poznyakoff
3f4f5a4bf4 (removed_prefixes_p): New function 2004-08-31 11:47:02 +00:00
Paul Eggert
c4e054673b (excluded_name, safer_name_suffix, stripped_prefix_len):
FILESYSTEM_PREFIX_LEN -> FILE_SYSTEM_PREFIX_LEN.
2004-08-07 06:33:07 +00:00
Sergey Poznyakoff
b121917368 (safer_name_suffix): Fixed bug intraduced 2004-05-11. 2004-05-19 10:57:25 +00:00
Sergey Poznyakoff
463d99453f Fix improper use of 'path' word 2004-05-16 20:50:55 +00:00
Sergey Poznyakoff
ecb338ad8e (safer_name_suffix): (safer_name_suffix): Use "%s"
as the format argument, rather than a possibly-translated variable
string. Patch provided by Jim Meyering  <jim@meyering.net>
2004-05-11 14:12:39 +00:00
Sergey Poznyakoff
6c1654791d (name_gather): Bugfix: Honor single -C with --same-order 2004-05-07 14:46:37 +00:00
Paul Eggert
2bda83b48d Merge recent gnulib changes, and remove some lint. 2004-04-05 02:29:18 +00:00
uid65697
f30c03c934 (safer_name_suffix): Reverted change made 2003-11-14. Reason: Discussion with Paul Eggert and Jean-Louis Martineau. See also ChangeLog entry from 1999-08-14. 2003-12-25 10:19:40 +00:00
Sergey Poznyakoff
22ae47de82 Use new diagnostics functions. 2003-11-17 07:39:33 +00:00
Sergey Poznyakoff
3bfdc3f8ce (safer_name_suffix): If the input file name ends with a slash, output one should do so as well. 2003-11-14 09:57:49 +00:00
Sergey Poznyakoff
052118a907 (safer_name_suffix): Skip leading ./ 2003-11-13 22:27:23 +00:00
Sergey Poznyakoff
c95535bae8 (all_names_found): Check if the argument
contains valid filename. Fixes coredump on "not_a_tar_file"
2003-11-13 08:46:53 +00:00
Sergey Poznyakoff
80e978dc2e Removed spurious includes. 2003-10-08 11:17:52 +00:00
Paul Eggert
1e7d274cd8 Fix some misspellings. 2003-10-04 22:30:52 +00:00
Sergey Poznyakoff
91493ea9b6 Count number of occurrences of each name in the
archive.
(name_match): Honor --occurence option.
(names_done): Removed
(all_names_found,names_notfound): Rewritten.
2003-10-04 13:50:41 +00:00
Sergey Poznyakoff
f364d50661 Take regexps into account 2003-10-02 10:41:48 +00:00
Sergey Poznyakoff
9373182407 (names_done): New function. 2003-10-02 10:28:30 +00:00
Paul Eggert
07286647fb --strip strips file system prefix too, and it counts adjacent
slashes as if they were one slash.
2003-09-22 18:54:50 +00:00
Sergey Poznyakoff
3590887776 (cut_path_elements): New functon. 2003-09-04 15:47:26 +00:00
Sergey Poznyakoff
83c68b4e40 (gid_to_gname,gname_to_gid,uid_to_uname,uname_to_uid): Changed prototypes 2003-09-01 17:01:35 +00:00
Paul Eggert
935cd4f515 (namelist_match): Allow partial matches only if recursive.
(hash_string_hasher): Renamed from hash_avoided_name.
(hash_string_compare): Renamed from compare_avoided_anames.
(hash_string_insert, hash_string_lookup): New functions.
(add_avoided_name, is_avoided_name): Use them.
(safer_name_suffix): New function.
(contains_dot_dot): Moved here from misc.c.  Now returns bool, not int.
2003-07-05 07:17:20 +00:00
Paul Eggert
421568c002 (name_gather, addname): Use offsetof when computing sizes for
struct hack; this avoids wasted space in some cases.
(name_gather): Use strcpy, not memcpy.
for consistency with other code that does similar things.
(read_name_from_file, name_next, name_gather, add_hierarchy_to_namelist):
Avoid quadratic behavior when reallocating buffers.
Check for buffer size overflow.
(addname): Avoid unnecessary clearing of memory.
2001-08-29 21:37:27 +00:00
Paul Eggert
4f07b06506 (collect_and_sort_names): If ignore_failed_read_option, only warn about
stat errors.

(excluded_name): Now returns bool.  Simplify, as the fancy features are
now all in excluded_filename.
2001-08-27 14:34:24 +00:00
Paul Eggert
9b71c10982 (name_next): Don't assume '/' is the only directory separator.
(namelist_match): Likewise.
(add_hierarchy_to_namelist): Remove dirsize arg.
Do not assume '/' is the only directory separator.
(new_name): Likewise.
2001-01-13 05:59:29 +00:00
Paul Eggert
fb93b996c8 (namelist_match, excluded_name): Do not match subfiles of a directory
if --no-recursion is specified.
2000-10-29 05:30:02 +00:00
Paul Eggert
8d37615dc4 (namelist_match): New function.
(name_match, name_scan): Use it, to eliminate duplicate code.
(names_notfound): Remove special case for Amiga.
2000-10-28 12:42:45 +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
f0429c4a22 (<quotearg.h>): New include.
(name_init, name_next, name_close, names_notfound, collect_and_sort_names):
Don't assume that gettext preserves errno.
Quote arbitrary strings in diagnostics.
(excluded_name): Fix typo that caused empty patterns to be mishandled.
1999-12-13 04:52:26 +00:00
Paul Eggert
bc9dc01ec3 (name_next): If file names are given both in the
command line (e.g. via -C) and in a file (via -T), do not
ignore the command-line names.
1999-12-03 13:04:17 +00:00
Paul Eggert
6e36ce5668 (name_next): Go back to using plain chdir.
(name_gather): Use chdir_arg to keep track of arguments to chdir.
(addname): Likewise.
(name_match): Use chdir_do to act on chdir args.
(merge_sort): Moved here from incremen.c.
(compare_names, add_hierarchy_to_namelist, collect_and_sort_names):
Likewise.
(name_expand): Remove.
(name_from_list): Skip fack names.
Use chdir_do to act on chdir args.
(struct avoided_name): New struct.
(avoided_names): New var.
(add_avoided_name, is_avoided_name): New functions.
1999-09-23 06:22:31 +00:00
Paul Eggert
bd5bbd4f65 Remove lint.
(name_gather): Handle trailing -C option correctly.
(addname): use memcpy, not strncpy, to copy a string of known length.
(name_match): Handle trailing -C option correctly.
Propagate -C option to following files.
Simplify matching code.
(name_scan): Simplify matching code.
1999-08-23 09:55:55 +00:00
Paul Eggert
f74aea3ae3 (name_next): Use chdir_from_initial_wd, not chdir.
(name_gather): Handle `-C x -C y' correctly.
Do not rely on addname to handle -C.
(addname): New CHANGE_DIR parameter.
Remove ugly calls to getcwd; no longer needed now that we have save-cwd.
(name_match): Use chdir_from_initial_wd, not chdir.
(name_from_list): Likewise.
1999-08-20 08:53:21 +00:00
Paul Eggert
92a680ff64 (_GNU_SOURCE): Define.
(<fnmatch.h>): Include unconditionally.
(excluded_name): New function, taking over duties of excluded_pathname.
All uses changed.
1999-08-11 12:47:01 +00:00
Paul Eggert
8e8acfbc97 (exclude_pool, exclude_pool_size, allocated_exclude_pool_size,
simple_exclude_array, simple_excludes, allocated_simple_excludes,
pattern_exclude_array, pattern_excludes, allocated_pattern_excludes,
add_exclude, add_exclude_file, check_exclude): Remove; now done in
../lib/exclude.c.
1999-07-08 03:45:21 +00:00
Paul Eggert
6290150c47 Fix copyright notice. 1999-07-01 21:01:44 +00:00
Paul Eggert
2e4d78d856 (cached_no_such_uname, cached_no_such_gname, cached_no_such_uid,
cached_no_such_gid): New vars.
(uid_to_uname, gid_to_gname, uname_to_uid, gname_to_gid):
Cache failures, too.
1999-01-31 02:53:47 +00:00
Paul Eggert
887188311d (uid_to_uname, gid_to_gname): Don't used cached name for nameless
users and groups.
1998-08-07 19:09:15 +00:00
Paul Eggert
f3531f64fb (name_init): Fix typo in error message: FILE* was passed, but char*
was wanted.

(read_name_from_file, name_gather, addname, name_match, name_scan,
add_exclude): Use size_t when appropriate.  Remove now-useless casts.

(exclude_pool_size, allocated_exclude_pool_size): Now size_t.
1997-10-31 00:58:55 +00:00
Paul Eggert
768c69b838 GNU tar 1.12 1997-04-22 05:35:50 +00:00
François Pinard
6ad38495a4 *** empty log message *** 1994-11-16 02:57:10 +00:00
François Pinard
9e48a4d0ca *** empty log message *** 1994-11-16 02:57:08 +00:00
François Pinard
26aaccb0e9 Initial revision 1994-11-16 02:57:06 +00:00
François Pinard
c086e08a4b *** empty log message *** 1994-11-16 02:56:34 +00:00
François Pinard
e4b2fc0bd9 *** empty log message *** 1994-11-16 02:56:30 +00:00