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

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