Browse Source

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
master
Nico Seessle 24 years ago
parent
commit
f9775c2211
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      src/main/org/apache/tools/ant/taskdefs/Property.java

+ 6
- 2
src/main/org/apache/tools/ant/taskdefs/Property.java View File

@@ -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) {


Loading…
Cancel
Save