From f9775c22112b1b3fd6927614957124ef9e52ad96 Mon Sep 17 00:00:00 2001 From: Nico Seessle Date: Sun, 25 Mar 2001 19:11:18 +0000 Subject: [PATCH] Fix for Bug #975 - sometimes (for example with a default installation of cygwin) there are environment-variables containing a new-line. We ignore anything after the first line and log the ignored lines with warning-level. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268885 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Property.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Property.java b/src/main/org/apache/tools/ant/taskdefs/Property.java index f6148dc6a..0286ed06d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Property.java +++ b/src/main/org/apache/tools/ant/taskdefs/Property.java @@ -245,8 +245,12 @@ public class Property extends Task { for (Enumeration e = osEnv.elements(); e.hasMoreElements(); ) { String entry = (String)e.nextElement(); int pos = entry.indexOf('='); - props.put(prefix + entry.substring(0, pos), - entry.substring(pos + 1)); + if (pos == -1) { + log("Ignoring: " + entry, Project.MSG_WARN); + } else { + props.put(prefix + entry.substring(0, pos), + entry.substring(pos + 1)); + } } addProperties(props); } catch (Exception ex) {