]> Dogcows Code - chaz/tar/blobdiff - src/create.c
(struct tar_sparse_optab.sparse_member_p)
[chaz/tar] / src / create.c
index 065e6fafd511fcb454b891cef56c43a91b4d7bba..71bacc4058751133b7665cd8e776a4f16cf78742 100644 (file)
@@ -519,7 +519,16 @@ write_long_name (struct tar_stat_info *st)
       xheader_store ("path", st, NULL);
       break;
 
-    case V7_FORMAT:                  
+    case V7_FORMAT:
+      if (strlen (st->file_name) > NAME_FIELD_SIZE-1)
+       {
+         WARN ((0, 0, _("%s: file name is too long (max %d); not dumped"),
+                quotearg_colon (st->file_name),
+                NAME_FIELD_SIZE - 1));
+         return NULL;
+       }
+      break;
+      
     case USTAR_FORMAT:
     case STAR_FORMAT:
       return write_ustar_long_name (st->file_name);
@@ -539,7 +548,6 @@ static union block *
 write_extended (struct tar_stat_info *st, union block *old_header)
 {
   union block *header, hp;
-  size_t size;
   char *p;
 
   if (extended_header.buffer || extended_header.stk == NULL)
@@ -668,7 +676,7 @@ start_header (struct tar_stat_info *st)
       xheader_store ("ctime", st, NULL);
     }
   else if (incremental_option)
-    if (archive_format == OLDGNU_FORMAT)
+    if (archive_format == OLDGNU_FORMAT || archive_format == GNU_FORMAT)
       {
        TIME_TO_CHARS (st->stat.st_atime, header->oldgnu_header.atime);
        TIME_TO_CHARS (st->stat.st_ctime, header->oldgnu_header.ctime);
@@ -762,10 +770,6 @@ void
 finish_header (struct tar_stat_info *st,
               union block *header, off_t block_ordinal)
 {
-  size_t i;
-  int sum;
-  char *p;
-
   /* Note: It is important to do this before the call to write_extended(),
      so that the actual ustar header is printed */
   if (verbose_option
This page took 0.021418 seconds and 4 git commands to generate.