From: Dave Reisner Date: Fri, 22 Feb 2013 00:01:06 +0000 (-0500) Subject: mtree: fix line filename length calculation. X-Git-Tag: v3.1.900a~360^2~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e65bf287f0133426b26611fe3e80b51267987106;p=thirdparty%2Flibarchive.git mtree: fix line filename length calculation. Fixes #301. Signed-off-by: Andres Mejia --- diff --git a/libarchive/archive_write_set_format_mtree.c b/libarchive/archive_write_set_format_mtree.c index 9c0613c9b..f37f723c6 100644 --- a/libarchive/archive_write_set_format_mtree.c +++ b/libarchive/archive_write_set_format_mtree.c @@ -1855,9 +1855,9 @@ mtree_entry_setup_filenames(struct archive_write *a, struct mtree_entry *file, return (ret); } - /* Make a basename from dirname and slash */ + /* Make a basename from file->parentdir.s and slash */ *slash = '\0'; - file->parentdir.length = slash - dirname; + file->parentdir.length = slash - file->parentdir.s; archive_strcpy(&(file->basename), slash + 1); return (ret); }