From a29bda0274f550903f295a77fec3a85e7b58bb13 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 18 Mar 2009 04:40:44 +0000 Subject: [PATCH] properly set the size of directories git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@755473 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/tar/TarEntry.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/tar/TarEntry.java b/src/main/org/apache/tools/tar/TarEntry.java index fb0464d8d..180315f54 100644 --- a/src/main/org/apache/tools/tar/TarEntry.java +++ b/src/main/org/apache/tools/tar/TarEntry.java @@ -215,12 +215,13 @@ public class TarEntry implements TarConstants { if (nameLength == 0 || name.charAt(nameLength - 1) != '/') { this.name.append("/"); } + this.size = 0; } else { this.mode = DEFAULT_FILE_MODE; this.linkFlag = LF_NORMAL; + this.size = file.length(); } - this.size = file.length(); this.modTime = file.lastModified() / MILLIS_PER_SECOND; this.devMajor = 0; this.devMinor = 0;