forked from I2P_Developers/i2p.i2p
Pluck of 40d650b134e48bdb0bb636227381c22217365c47
* WorkingDir: Correctly strip DOS line endings while migrating, to fix eepsite location on 0.9.5 Windows installs (ticket #919) applied changes from cc74155815c98674b74cd7d9abb59704005d6b85 through 40d650b134e48bdb0bb636227381c22217365c47
This commit is contained in:
@@ -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 {
|
|||||||
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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user