I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit ddc5e2c2 authored by zzz's avatar zzz
Browse files

* WorkingDir: Correctly strip DOS line endings while migrating,

               to fix eepsite location on 0.9.5 Windows installs (ticket #919)
parent 3086fd3c
No related branches found
No related tags found
No related merge requests found
...@@ -294,6 +294,9 @@ public class WorkingDir { ...@@ -294,6 +294,9 @@ public class WorkingDir {
String s = null; String s = null;
boolean isDaemon = DAEMON_USER.equals(System.getProperty("user.name")); boolean isDaemon = DAEMON_USER.equals(System.getProperty("user.name"));
while ((s = DataHelper.readLine(in)) != null) { while ((s = DataHelper.readLine(in)) != null) {
// readLine() doesn't strip \r
if (s.endsWith("\r"))
s = s.substring(0, s.length() - 1);
if (s.endsWith("=\"eepsite/jetty.xml\"")) { if (s.endsWith("=\"eepsite/jetty.xml\"")) {
s = s.replace("=\"eepsite/jetty.xml\"", "=\"" + todir.getAbsolutePath() + s = s.replace("=\"eepsite/jetty.xml\"", "=\"" + todir.getAbsolutePath() +
File.separatorChar + "eepsite" + File.separatorChar + "eepsite" +
...@@ -333,6 +336,9 @@ public class WorkingDir { ...@@ -333,6 +336,9 @@ public class WorkingDir {
out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new SecureFileOutputStream(newFile), "UTF-8"))); out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new SecureFileOutputStream(newFile), "UTF-8")));
String s = null; String s = null;
while ((s = DataHelper.readLine(in)) != null) { while ((s = DataHelper.readLine(in)) != null) {
// readLine() doesn't strip \r
if (s.endsWith("\r"))
s = s.substring(0, s.length() - 1);
if (s.indexOf(oldString) >= 0) { if (s.indexOf(oldString) >= 0) {
s = s.replace(oldString, newString); s = s.replace(oldString, newString);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment