]> Dogcows Code - chaz/tar/commitdiff
Bugfix.
authorSergey Poznyakoff <gray@gnu.org.ua>
Sun, 4 Aug 2013 15:45:15 +0000 (18:45 +0300)
committerSergey Poznyakoff <gray@gnu.org.ua>
Sun, 4 Aug 2013 15:45:15 +0000 (18:45 +0300)
* src/names.c (read_name_from_file): Fix a typo. Remove
unused variable.

src/names.c
tests/T-zfile.at

index 3704a919cecd7e59b73ec81febaa718332e6404b..4710848fa1be4e740630b2bc70da59e102577978 100644 (file)
@@ -363,11 +363,10 @@ read_name_from_file (struct name_elt *ent)
   size_t counter = 0;
   FILE *fp = ent->v.file.fp;
   int term = ent->v.file.term;
-  size_t count;
   
   for (c = getc (fp); c != EOF && c != term; c = getc (fp))
     {
-      if (count == name_buffer_length)
+      if (counter == name_buffer_length)
        name_buffer = x2realloc (name_buffer, &name_buffer_length);
       name_buffer[counter++] = c;
       if (c == 0)
@@ -381,7 +380,7 @@ read_name_from_file (struct name_elt *ent)
   if (counter == 0 && c != EOF)
     return file_list_skip;
 
-  if (count == name_buffer_length)
+  if (counter == name_buffer_length)
     name_buffer = x2realloc (name_buffer, &name_buffer_length);
   name_buffer[counter] = 0;
 
index f4adfe834a6daea5f75afd7ce35dea8f79ae57be..8761c7c4aec3e01d815f7edc90d8949b79952942 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Tar malfunctioned when given empty file as an argument to -T.
+#
+# Reported by: Michal Žejdl <zejdl@suas.cz>
+# References: <http://lists.gnu.org/archive/html/bug-tar/2013-07/msg00009.html>
+
 AT_SETUP([empty file])
 AT_KEYWORDS([files-from empty-file])
 
This page took 0.021279 seconds and 4 git commands to generate.