]> Dogcows Code - chaz/tar/commitdiff
*** empty log message ***
authorFrançois Pinard <pinard@iro.umontreal.ca>
Wed, 16 Nov 1994 02:43:31 +0000 (02:43 +0000)
committerFrançois Pinard <pinard@iro.umontreal.ca>
Wed, 16 Nov 1994 02:43:31 +0000 (02:43 +0000)
src/create.c
src/port.c
src/version.c

index 1bc82beb02be3e0412e9e6b2d9a711707cc91bcd..16906f73e2faa32e19ea0063365f260824afece8 100644 (file)
@@ -534,7 +534,7 @@ dump_file (p, curdev, toplevel)
          /*                    sum += i;
                        if (sum < upperbound)
                                goto extend;*/
-         if (index_offset + i < upperbound)
+         if (index_offset + i <= upperbound)
            {
              index_offset += i;
              exhdr->ext_hdr.isextended++;
@@ -1055,7 +1055,7 @@ deal_with_sparse (name, header, nulls_at_end)
                 * realloc the scratch area, since we've run out of room --
                 */
          sparsearray = (struct sp_array *)
-           realloc (sparsearray,
+           ck_realloc (sparsearray,
                     2 * sp_array_size * (sizeof (struct sp_array)));
          sp_array_size *= 2;
        }
@@ -1105,6 +1105,11 @@ deal_with_sparse (name, header, nulls_at_end)
     }
   if (amidst_data)
     sparsearray[sparse_ind++].numbytes = numbytes;
+  else
+    {
+      sparsearray[sparse_ind].offset = offset-1;
+      sparsearray[sparse_ind++].numbytes = 1;
+    }
   close (fd);
 
   return sparse_ind - 1;
index 2f3c28240aa6bc440688267497372446b0fea0fa..c45ee3a9955c94227bd98808020fdadbb48b0aba 100644 (file)
@@ -177,14 +177,22 @@ rename (from, to)
 {
   struct stat from_stats;
 
-  if (stat (from, &from_stats) == 0)
+  if (stat (from, &from_stats))
+    return -1;
+
+  if (unlink (to) && errno != ENOENT)
+    return -1;
+
+  if (link (from, to))
+    return -1;
+
+  if (unlink (from) && errno != ENOENT)
     {
-      if (unlink (to) && errno != ENOENT)
-       return -1;
-      if (link (from, to) == 0 && (unlink (from) == 0 || errno == ENOENT))
-       return 0;
+      unlink (to);
+      return -1;
     }
-  return -1;
+
+  return 0;
 }
 #endif
 
index eaa515244ac2b3eda18b5b02837c7f217dd01c4d..5b11cea111602ecce219438c2794103afe68489b 100644 (file)
@@ -17,4 +17,4 @@ You should have received a copy of the GNU General Public License
 along with GNU Tar; see the file COPYING.  If not, write to
 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
    
-char version_string[] = "GNU tar version 1.10.14";
+char version_string[] = "GNU tar version 1.10.15";
This page took 0.025651 seconds and 4 git commands to generate.