From e1ac74c48c3c0d38350e4a3b139aa80d917b93d5 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Mon, 10 Dec 2001 16:05:08 +0000 Subject: [PATCH] repair the broken logic of my last patch (my fault not the original submitter's). git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270110 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Touch.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Touch.java b/src/main/org/apache/tools/ant/taskdefs/Touch.java index 57a94e60b..bd049d4f6 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Touch.java +++ b/src/main/org/apache/tools/ant/taskdefs/Touch.java @@ -180,7 +180,11 @@ public class Touch extends Task { log("modification time of files cannot be set in JDK 1.1", Project.MSG_WARN); return; - } else { + } + + boolean resetMillis = false; + if (millis < 0) { + resetMillis = true; millis = System.currentTimeMillis(); } @@ -205,6 +209,10 @@ public class Touch extends Task { touch(new File(fromDir, srcDirs[j])); } } + + if (resetMillis) { + millis = -1; + } } protected void touch(File file) throws BuildException {