]> Dogcows Code - chaz/tar/blobdiff - src/incremen.c
tar: pacify GCC 5.1 -Wformat-signedness
[chaz/tar] / src / incremen.c
index 07e757adfa4f97a9313cceb9b4f31ea376d735bf..e549bbd312a43529ead17d1e0d28a86223f479df 100644 (file)
@@ -1,6 +1,6 @@
 /* GNU dump extensions to tar.
 
-   Copyright 1988, 1992-1994, 1996-1997, 1999-2001, 2003-2009, 2013
+   Copyright 1988, 1992-1994, 1996-1997, 1999-2001, 2003-2009, 2013-2014
    Free Software Foundation, Inc.
 
    This file is part of GNU tar.
@@ -280,7 +280,7 @@ free_directory (struct directory *dir)
 static struct directory *
 attach_directory (const char *name)
 {
-  char *cname = normalize_filename (name);
+  char *cname = normalize_filename (chdir_current, name);
   struct directory *dir = make_directory (name, cname);
   if (dirtail)
     dirtail->next = dir;
@@ -370,7 +370,7 @@ find_directory (const char *name)
     return 0;
   else
     {
-      char *caname = normalize_filename (name);
+      char *caname = normalize_filename (chdir_current, name);
       struct directory *dir = make_directory (name, caname);
       struct directory *ret = hash_lookup (directory_table, dir);
       free_directory (dir);
@@ -734,6 +734,8 @@ scan_directory (struct tar_stat_info *st)
   if (! dirp)
     savedir_error (dir);
 
+  info_attach_exclist (st);
+
   tmp = xstrdup (dir);
   zap_slashes (tmp);
 
@@ -759,10 +761,10 @@ scan_directory (struct tar_stat_info *st)
               entry = dumpdir_next (itr))
            {
              char *full_name = namebuf_name (nbuf, entry + 1);
-             
+
              if (*entry == 'I') /* Ignored entry */
                *entry = 'N';
-             else if (excluded_name (full_name))
+             else if (excluded_name (full_name, st))
                *entry = 'N';
              else
                {
@@ -792,7 +794,7 @@ scan_directory (struct tar_stat_info *st)
                            diag = stat_diag;
                        }
                    }
-                 
+
                  if (diag)
                    {
                      file_removed_diag (full_name, false, diag);
@@ -806,7 +808,7 @@ scan_directory (struct tar_stat_info *st)
                      else if (directory->children == ALL_CHILDREN)
                        pd_flag |= PD_FORCE_CHILDREN | ALL_CHILDREN;
                      *entry = 'D';
-                     
+
                      stsub.parent = st;
                      procdir (full_name, &stsub, pd_flag, entry);
                      restore_parent_fd (&stsub);
@@ -823,7 +825,7 @@ scan_directory (struct tar_stat_info *st)
                    *entry = 'N';
                  else
                    *entry = 'Y';
-                 
+
                  tar_stat_destroy (&stsub);
                }
            }
@@ -832,7 +834,7 @@ scan_directory (struct tar_stat_info *st)
       else if (directory->tagfile)
        maketagdumpdir (directory);
     }
-  
+
   namebuf_free (nbuf);
 
   free (dirp);
@@ -1153,11 +1155,14 @@ read_num (FILE *fp, char const *fieldname,
     }
 
   if (c)
-    FATAL_ERROR ((0, 0,
-                 _("%s: byte %s: %s %s followed by invalid byte 0x%02x"),
-                 quotearg_colon (listed_incremental_option),
-                 offtostr (ftello (fp), offbuf),
-                 fieldname, buf, c));
+    {
+      unsigned uc = c;
+      FATAL_ERROR ((0, 0,
+                   _("%s: byte %s: %s %s followed by invalid byte 0x%02x"),
+                   quotearg_colon (listed_incremental_option),
+                   offtostr (ftello (fp), offbuf),
+                   fieldname, buf, uc));
+    }
 
   *pval = strtosysint (buf, NULL, min_val, max_val);
   conversion_errno = errno;
@@ -1296,8 +1301,8 @@ void
 show_snapshot_field_ranges (void)
 {
   struct field_range const *p;
-  char minbuf[max (SYSINT_BUFSIZE, INT_BUFSIZE_BOUND (intmax_t))];
-  char maxbuf[max (SYSINT_BUFSIZE, INT_BUFSIZE_BOUND (uintmax_t))];
+  char minbuf[SYSINT_BUFSIZE];
+  char maxbuf[SYSINT_BUFSIZE];
 
   printf("This tar's snapshot file field ranges are\n");
   printf ("   (%-15s => [ %s, %s ]):\n\n", "field name", "min", "max");
@@ -1406,7 +1411,7 @@ write_directory_file_entry (void *entry, void *data)
 
   if (DIR_IS_FOUND (directory))
     {
-      char buf[max (SYSINT_BUFSIZE, INT_BUFSIZE_BOUND (intmax_t))];
+      char buf[SYSINT_BUFSIZE];
       char const *s;
 
       s = DIR_IS_NFS (directory) ? "1" : "0";
@@ -1539,9 +1544,10 @@ dumpdir_ok (char *dumpdir)
     {
       if (expect && *p != expect)
        {
+         unsigned char uc = *p;
          ERROR ((0, 0,
                  _("Malformed dumpdir: expected '%c' but found %#3o"),
-                 expect, *p));
+                 expect, uc));
          return false;
        }
       switch (*p)
This page took 0.024483 seconds and 4 git commands to generate.