]> Dogcows Code - chaz/tar/blobdiff - src/xheader.c
Update copyright year to 2006.
[chaz/tar] / src / xheader.c
index 8f727a9a5eb1c24f7179aad6e935b9180df5eec7..087cb1baca957928f07bd1fda2c6b7f1f9f7e5b4 100644 (file)
@@ -1,6 +1,6 @@
 /* POSIX extended headers for tar.
 
-   Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2005, 2006 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
@@ -235,6 +235,7 @@ xheader_format_name (struct tar_stat_info *st, const char *fmt, size_t n)
   size_t len = strlen (fmt);
   char *q;
   const char *p;
+  char *dirp = NULL;
   char *dir = NULL;
   char *base = NULL;
   char pidbuf[UINTMAX_STRSIZE_BOUND];
@@ -253,8 +254,9 @@ xheader_format_name (struct tar_stat_info *st, const char *fmt, size_t n)
        case 'd':
          if (st)
            {
-             dir = safer_name_suffix (dir_name (st->orig_file_name),
-                                      false, absolute_names_option);
+             if (!dirp)
+               dirp = dir_name (st->orig_file_name);
+             dir = safer_name_suffix (dirp, false, absolute_names_option);
              len += strlen (dir) - 2;
            }
          break;
@@ -328,6 +330,8 @@ xheader_format_name (struct tar_stat_info *st, const char *fmt, size_t n)
        *q++ = *p++;
     }
 
+  free (dirp);
+  
   /* Do not allow it to end in a slash */
   while (q > buf && ISSLASH (q[-1]))
     q--;
@@ -1245,7 +1249,7 @@ sparse_map_decoder (struct tar_stat_info *st, char const *arg,
          else
            {
              ERROR ((0, 0, _("Malformed extended header: excess %s=%s"),
-                     "GNU.sparse.numbytes", arg));
+                     keyword, arg));
              return;
            }
        }
This page took 0.026574 seconds and 4 git commands to generate.