Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 58590 invoked from network); 20 Nov 2003 12:08:20 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 20 Nov 2003 12:08:20 -0000 Received: (qmail 57894 invoked by uid 500); 20 Nov 2003 12:08:19 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 57550 invoked by uid 500); 20 Nov 2003 12:08:17 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 57537 invoked by uid 500); 20 Nov 2003 12:08:17 -0000 Received: (qmail 57534 invoked from network); 20 Nov 2003 12:08:16 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 20 Nov 2003 12:08:16 -0000 Received: (qmail 58566 invoked by uid 1539); 20 Nov 2003 12:08:17 -0000 Date: 20 Nov 2003 12:08:17 -0000 Message-ID: <20031120120817.58565.qmail@minotaur.apache.org> From: peterreilly@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/src/main/org/apache/tools/ant/util FileUtils.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N peterreilly 2003/11/20 04:08:17 Modified: src/main/org/apache/tools/ant/util FileUtils.java Log: Check if parent file is not null before using it Revision Changes Path 1.59 +3 -3 ant/src/main/org/apache/tools/ant/util/FileUtils.java Index: FileUtils.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/FileUtils.java,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- FileUtils.java 24 Oct 2003 05:44:02 -0000 1.58 +++ FileUtils.java 20 Nov 2003 12:08:17 -0000 1.59 @@ -545,7 +545,7 @@ // ensure that parent dir of dest file exists! // not using getParentFile method to stay 1.1 compat File parent = getParentFile(destFile); - if (!parent.exists()) { + if (parent != null && !parent.exists()) { parent.mkdirs(); } @@ -1383,7 +1383,7 @@ } File parent = getParentFile(to); - if (!parent.exists() && !parent.mkdirs()) { + if (parent != null && !parent.exists() && !parent.mkdirs()) { throw new IOException("Failed to create directory " + parent + " while trying to rename " + from); } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org