Skip to content
Permalink
Browse files

Fix JENKINS-14284

  • Loading branch information...
gboissinot committed Jul 2, 2012
1 parent e8105b8 commit 2be7887c9c5c8c01ad47070c4807a159a137ec97
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/main/java/org/jenkinsci/plugins/envinject/service/PropertiesLoader.java
@@ -39,6 +39,7 @@
try {
String fileContent = Util.loadFile(propertiesFile);
String fileContentResolved = Util.replaceMacro(fileContent, currentEnvVars);
fileContentResolved = processPath(fileContentResolved);
properties.load(new StringReader(fileContentResolved));
} catch (IOException ioe) {
throw new EnvInjectException("Problem occurs on loading content", ioe);
@@ -66,6 +67,8 @@
return null;
}

content = processPath(content);

Map<String, String> result = new LinkedHashMap<String, String>();
StringReader stringReader = new StringReader(content);
SortedProperties properties = new SortedProperties();
@@ -87,14 +90,17 @@ private String processProperty(Object prop) {
if (prop == null) {
return null;
}
return processPath(String.valueOf(prop).trim());

return String.valueOf(prop).trim();
}

private String processPath(String content) {
if (content == null) {
return null;
}
return content.replace("\\", "\\\\");

content = content.replace("\\", "\\\\");
return content.replace("\\\\\n", "\\\n");
}

}

0 comments on commit 2be7887

Please sign in to comment.
You can’t perform that action at this time.