]> Dogcows Code - chaz/tar/commitdiff
(collect_and_sort_names): If ignore_failed_read_option, only warn about
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 27 Aug 2001 14:34:24 +0000 (14:34 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 27 Aug 2001 14:34:24 +0000 (14:34 +0000)
stat errors.

(excluded_name): Now returns bool.  Simplify, as the fancy features are
now all in excluded_filename.

src/names.c

index 202b64dbdebd1a32e023369090d29cf52b820bcb..2b009cb8152eaad3485ce5c022c05ff054284b2b 100644 (file)
@@ -1,5 +1,7 @@
 /* Various processing of names.
-   Copyright 1988,92,94,96,97,98,99,2000, 2001 Free Software Foundation, Inc.
+
+   Copyright 1988, 1992, 1994, 1996, 1997, 1998, 1999, 2000, 2001 Free
+   Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by the
@@ -764,7 +766,10 @@ collect_and_sort_names (void)
 
       if (deref_stat (dereference_option, name->name, &statbuf) != 0)
        {
-         stat_error (name->name);
+         if (ignore_failed_read_option)
+           stat_warn (name->name);
+         else
+           stat_error (name->name);
          continue;
        }
       if (S_ISDIR (statbuf.st_mode))
@@ -863,23 +868,10 @@ new_name (const char *path, const char *name)
 /* Return nonzero if file NAME is excluded.  Exclude a name if its
    prefix matches a pattern that contains slashes, or if one of its
    components matches a pattern that contains no slashes.  */
-int
+bool
 excluded_name (char const *name)
 {
-  char const *p;
-  name += FILESYSTEM_PREFIX_LEN (name);
-
-  if (excluded_filename (excluded_with_slash, name,
-                        FNM_FILE_NAME | recursion_option))
-    return 1;
-
-  for (p = name; *p; p++)
-    if (((p == name || ISSLASH (p[-1])) && !ISSLASH (p[0]))
-       && excluded_filename (excluded_without_slash, p,
-                             FNM_FILE_NAME | FNM_LEADING_DIR))
-      return 1;
-
-  return 0;
+  return excluded_filename (excluded, name + FILESYSTEM_PREFIX_LEN (name));
 }
 \f
 /* Names to avoid dumping.  */
This page took 0.023666 seconds and 4 git commands to generate.