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

f0f11f
diff --git a/src/tar.c b/src/tar.c
f0f11f
index 97d74bc..6de8961 100644
f0f11f
--- a/src/tar.c
f0f11f
+++ b/src/tar.c
f0f11f
@@ -48,10 +48,12 @@ split_long_name (const char *name, size_t length)
f0f11f
 {
f0f11f
   size_t i;
f0f11f
 
f0f11f
-  if (length > TARPREFIXSIZE)
f0f11f
-    length = TARPREFIXSIZE+2;
f0f11f
+  if (length > TARPREFIXSIZE + 1)
f0f11f
+    length = TARPREFIXSIZE + 1;
f0f11f
+  else if (ISSLASH (name[length - 1]))
f0f11f
+    length--;
f0f11f
   for (i = length - 1; i > 0; i--)
f0f11f
-    if (name[i] == '/')
f0f11f
+    if (ISSLASH (name[i]))
f0f11f
       break;
f0f11f
   return i;
f0f11f
 }