Update OsMoThread.java
This commit is contained in:
parent
738c37b8cf
commit
5aa8512ee2
1 changed files with 8 additions and 20 deletions
|
@ -403,28 +403,16 @@ public class OsMoThread {
|
||||||
}
|
}
|
||||||
|
|
||||||
private StringBuilder prepareCommand(String l) {
|
private StringBuilder prepareCommand(String l) {
|
||||||
boolean addNL = true;
|
StringBuilder res = new StringBuilder(l.length());
|
||||||
StringBuilder res = new StringBuilder();
|
for(int i = 0; i < l.length(); i++) {
|
||||||
int i = 0;
|
char c = l.charAt(i);
|
||||||
while (true) {
|
if(c == '\n' || c == '=' || c == '\\') {
|
||||||
int ni = l.indexOf('\n');
|
res.append('\\')
|
||||||
if (ni == l.length() - 1) {
|
|
||||||
res.append(l.substring(i));
|
|
||||||
addNL = false;
|
|
||||||
break;
|
|
||||||
} else if (ni == -1) {
|
|
||||||
res.append(l.substring(i));
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
res.append(l.substring(i, ni));
|
|
||||||
res.append("\\").append("n");
|
|
||||||
}
|
}
|
||||||
i = ni + 1;
|
res.append(c);
|
||||||
}
|
}
|
||||||
if (addNL) {
|
|
||||||
l += "\n";
|
return res.toString().trim() +"=\n"
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getLastCommandTime() {
|
public long getLastCommandTime() {
|
||||||
|
|
Loading…
Reference in a new issue