forked from I2P_Developers/i2p.i2p
* WorkingDir: Correctly strip DOS line endings while migrating,
to fix eepsite location on 0.9.5 Windows installs (ticket #919)
This commit is contained in:
@ -294,6 +294,9 @@ public class WorkingDir {
|
||||
String s = null;
|
||||
boolean isDaemon = DAEMON_USER.equals(System.getProperty("user.name"));
|
||||
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\"")) {
|
||||
s = s.replace("=\"eepsite/jetty.xml\"", "=\"" + todir.getAbsolutePath() +
|
||||
File.separatorChar + "eepsite" +
|
||||
@ -333,6 +336,9 @@ public class WorkingDir {
|
||||
out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new SecureFileOutputStream(newFile), "UTF-8")));
|
||||
String s = 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) {
|
||||
s = s.replace(oldString, newString);
|
||||
}
|
||||
|
Reference in New Issue
Block a user