lib/exclude.c


Log

Author Commit Date CI Message
Paul Eggert 78248aae 2003-10-27T08:41:23 Modify exclude.c to use new xalloc primitives, for simplicity.
Paul Eggert 6942bbb5 2003-10-16T05:26:15 Do not include <inttypes.h> or <stdint.h>. (SIZE_MAX): Remove. (new_exclude, add_exclude_file): Initial size no longer needs to be a power of 2. (add_exclude, add_exclude_file): Use xnrealloc instead of rolling our own address arithmetic overflow checking.
Paul Eggert 5e28cd65 2003-09-09T03:15:05 Remove K&R cruft.
Paul Eggert f2b34427 2003-08-13T23:44:25 Fix typo in previous change; it mishandled the case when line_end was neither a space nor NUL.
Paul Eggert d3edff3b 2003-08-13T23:15:00 Ignore trailing white space and empty lines in files containing patterns to exclude.
Paul Eggert 721a7947 2003-06-04T23:35:46 (new_exclude, add_exclude): Remove casts that are unnecessary now that we assume C89 or better. This change imported from coreutils.
Paul Eggert 92295bc4 2003-06-04T19:22:29 .h files should stand alone, but we shouldn't include <sys/types.h> if we can get away with just <stddef.h>.
Paul Eggert 552a680f 2003-05-29T07:21:59 in lib: * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h, rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h> without checking for HAVE_LIMITS_H. * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c, xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed to do that. * fatal.c: Include <stdarg.h> without checking for __STDC__. * exclude.c: Include <stdbool.h> unconditionally. * tempname.c: Include <stddef.h> unconditionally. * hash.c: Include <limits.h>, since we no longer define CHAR_BIT. * modechange.c, rpmatch.c (NULL): Don't define, since <stddef.h> does that. * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed. * safe-read.c (INT_MAX): Don't define, since <limits.h> does that. * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed. * xstrtol.c: Likewise. * safe-read.c: Remove TYPE_SIGNED; no longer needed. * savedir.c: Include <stddef.h> instead of defining NULL. in m4: * backupfile.m4 (gl_BACKUPFILE): Don't check for limits.h. * fsusage.m4 (gl_PREREQ_FSUSAGE_EXTRA): Likewise. * human.m4 (gl_HUMAN): Likewise. * pathmax.m4 (gl_PATHMAX): Likewise. * rpmatch.m4 (gl_FUNC_RPMATCH): Likewise. * userspec.m4 (gl_USERSPEC): Likewise. * xreadlink.m4 (gl_XREADLINK): Likewise. * m4/xstrtol.m4 (gl_PREREQ_XSTRTOL): Likewise. * quote.m4 (gl_QUOTE): Don't check for stddef.h.
Jim Meyering 5aa1feeb 2003-04-05T06:53:24 Remove uses of `PARAMS'.
Paul Eggert ae37c409 2002-12-10T19:41:28 (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not defined (e.g., a pure POSIX system). (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
Jim Meyering 92f1833a 2001-11-17T13:29:42 Include unlocked-io.h.
Jim Meyering fcb712da 2001-09-30T06:26:46 (excluded_filename): 0 -> false, since it's a boolean context.
Jim Meyering a601ff2f 2001-09-03T18:45:20 (fnmatch_no_wildcards): Fix confusion between usage of FNM_CASEFOLD and FNM_LEADING_DIR. The bug was spotted by Jim Meyering.
Jim Meyering 02e3bf2a 2001-09-01T07:28:51 Use `""', not `<>' to #include non-system header files. (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp and strncasecmp as r-values. Unixware didn't have declarations.
Jim Meyering 42a7a591 2001-08-31T06:33:42 Merge 'exclude' changes from tar 1.13.22. This fixes one or two unlikely storage allocation overflow bugs, but doesn't change user-visible behavior otherwise. (bool): Declare, perhaps by including stdbool.h. (<sys/types.h>): Include only if HAVE_SYS_TYPES_H. (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>): Include if available. (<xalloc.h>): Include (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't. (verify): New macro. Use it to verify that EXCLUDE macros do not collide with FNM macros. (struct patopts): New struct. (struct exclude): Use it, as exclude patterns now come with options. (new_exclude): Support above changes. (new_exclude, add_exclude_file): Initial size must now be a power of two to simplify overflow checking. (free_exclude, fnmatch_no_wildcards): New function. (excluded_filename): No longer requires options arg, as the options are determined by add_exclude. Now returns bool, not int. (excluded_filename, add_exclude): Add support for the fancy new exclusion options. (add_exclude, add_exclude_file): Now takes int options arg. Check for arithmetic overflow when computing sizes. (add_exclude_file): xrealloc might modify errno, so don't realloc until after errno might be used.
Jim Meyering e9897e1c 2000-01-12T06:37:30 Sync to the slightly more general version of GNU tar.
Jim Meyering a2230838 1997-12-31T11:01:18 Use PARAMS, not __EXCLUDE_P.
Jim Meyering 5ce2b92a 1997-12-21T11:57:17 remove FIXME-describe comments
Jim Meyering 8a89b026 1997-12-21T11:56:34 add FIXME-describe comments
Jim Meyering 76b20a24 1997-12-21T11:43:34 .