2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2024-11-27 03:39:11 +00:00
xcat-dep/cpio/cpio-2.10-longnames-split.patch
xq2005 c17860af8c add cpio-2.11 into the xCAT dependecy
Former-commit-id: bd30424ca9b2f1bc3a4650e5875a9dea44da664d
2013-05-28 07:53:32 +00:00

21 lines
489 B
Diff

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