nico 01/03/25 11:11:18
Modified: src/main/org/apache/tools/ant/taskdefs Property.java
Log:
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.
Revision Changes Path
1.25 +6 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Property.java
Index: Property.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Property.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- Property.java 2001/01/08 12:42:47 1.24
+++ Property.java 2001/03/25 19:11:18 1.25
@@ -245,8 +245,12 @@
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) {