Blame SOURCES/cpio-2.10-longnames-split.patch

808377
From: Pavel Raiskup <praiskup@redhat.com>
808377
Date: Mon, 14 Sep 2015 09:49:12 +0200
808377
Subject: [PATCH 6/7] Fix for splitting long file names while creating ustar
808377
 archive
808377
808377
Resolves: #866467
808377
808377
diff --git a/src/tar.c b/src/tar.c
808377
index a2ce171..e2b5f45 100644
808377
--- a/src/tar.c
808377
+++ b/src/tar.c
808377
@@ -49,10 +49,12 @@ split_long_name (const char *name, size_t length)
808377
 {
808377
   size_t i;
808377
 
808377
-  if (length > TARPREFIXSIZE)
808377
-    length = TARPREFIXSIZE+2;
808377
+  if (length > TARPREFIXSIZE + 1)
808377
+    length = TARPREFIXSIZE + 1;
808377
+  else if (ISSLASH (name[length - 1]))
808377
+    length--;
808377
   for (i = length - 1; i > 0; i--)
808377
-    if (name[i] == '/')
808377
+    if (ISSLASH (name[i]))
808377
       break;
808377
   return i;
808377
 }