summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorStefan Bodewig <bodewig@apache.org>2010-03-25 14:14:53 +0000
committerStefan Bodewig <bodewig@apache.org>2010-03-25 14:14:53 +0000
commit520de2a8f461209ef5af346d144383c738c47235 (patch)
tree481c953067c27fdcf660d55eb64bffc7273fc3a6 /src/script
parent16b5178713e9d00a684c8469fa1c44058f55b041 (diff)
downloadant-520de2a8f461209ef5af346d144383c738c47235.tar.gz
bash completion failes if ant throws an exception. Submitted by Omer Shapira. PR 48980
git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@927416 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/script')
-rw-r--r--src/script/complete-ant-cmd.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/complete-ant-cmd.pl b/src/script/complete-ant-cmd.pl
index b58c26e15..37891241b 100644
--- a/src/script/complete-ant-cmd.pl
+++ b/src/script/complete-ant-cmd.pl
@@ -83,7 +83,7 @@ sub getTargets {
# cache-file.
my $cacheFile = $buildFile;
$cacheFile =~ s|(.*/)?(.*)|${1}.ant-targets-${2}|;
- if ((!-e $cacheFile) || (-M $buildFile) < (-M $cacheFile)) {
+ if ((!-e $cacheFile) || (-z $cacheFile) || (-M $buildFile) < (-M $cacheFile)) {
open( CACHE, '>'.$cacheFile ) || die "can\'t write $cacheFile: $!\n";
open( HELP, "$antCmd -projecthelp -f '$buildFile'|" ) || return();
my %targets;