]> Dogcows Code - chaz/tar/blobdiff - src/buffer.c
Use ngettext where appropriate.
[chaz/tar] / src / buffer.c
index a2a138a33b72967111ccc545398ab85f2f0d1021..fd16b6f1e39d4f42d34c8ba0ad761ea3c7a08f60 100644 (file)
@@ -669,8 +669,7 @@ open_archive (enum access_mode wanted_access)
   if (archive_names == 0)
     FATAL_ERROR ((0, 0, _("No archive name given")));
 
-  current_file_name = 0;
-  current_link_name = 0;
+  destroy_stat (&current_stat_info);
   save_name = 0;
   real_s_name = 0;
 
@@ -845,8 +844,8 @@ open_archive (enum access_mode wanted_access)
          else
            strcpy (record_start->header.name, volume_label_option);
 
-         assign_string (&current_file_name, record_start->header.name);
-         current_trailing_slash = strip_trailing_slashes (current_file_name);
+         assign_string (&current_stat_info.file_name, record_start->header.name);
+         current_stat_info.had_trailing_slash = strip_trailing_slashes (current_stat_info.file_name);
 
          record_start->header.typeflag = GNUTYPE_VOLHDR;
          TIME_TO_CHARS (start_time, record_start->header.mtime);
@@ -1056,8 +1055,15 @@ short_read (ssize_t status)
        break;
 
       if (! read_full_records_option)
-       FATAL_ERROR ((0, 0, _("Unaligned block (%lu bytes) in archive"),
-                     (unsigned long) (record_size - left)));
+       {
+         unsigned long rest = record_size - left;
+         
+         FATAL_ERROR ((0, 0,
+                       ngettext ("Unaligned block (%lu byte) in archive",
+                                 "Unaligned block (%lu bytes) in archive",
+                                 rest),
+                       rest));
+       }
 
       /* User warned us about this.  Fix up.  */
 
@@ -1070,8 +1076,14 @@ short_read (ssize_t status)
 
   if (!read_full_records_option && verbose_option
       && record_start_block == 0 && status > 0)
-    WARN ((0, 0, _("Record size = %lu blocks"),
-          (unsigned long) ((record_size - left) / BLOCKSIZE)));
+    {
+      unsigned long rsize = (record_size - left) / BLOCKSIZE;
+      WARN ((0, 0,
+            ngettext ("Record size = %lu block",
+                      "Record size = %lu blocks",
+                      rsize),
+            rsize));
+    }
 
   record_end = record_start + (record_size - left) / BLOCKSIZE;
   records_read++;
@@ -1362,10 +1374,7 @@ close_archive (void)
     }
 #endif /* !MSDOS */
 
-  if (current_file_name)
-    free (current_file_name);
-  if (current_link_name)
-    free (current_link_name);
+  destroy_stat (&current_stat_info);
   if (save_name)
     free (save_name);
   if (real_s_name)
This page took 0.022059 seconds and 4 git commands to generate.