mirror of
https://github.com/SKCraft/Launcher.git
synced 2025-03-01 03:51:46 +01:00
Tolerate missing terminating newlines in Java release files
Had a report out in the wild of a release file that doesn't end in a terminating newline, which was causing the parser to blow up. This commit relaxes the parsing to tolerate EOFs while parsing values.
This commit is contained in:
parent
1c663e1c04
commit
9bd7df4d3c
@ -85,6 +85,7 @@ public class EnvironmentParser {
|
|||||||
private String parseValue() throws IOException {
|
private String parseValue() throws IOException {
|
||||||
StringBuilder buffer = new StringBuilder();
|
StringBuilder buffer = new StringBuilder();
|
||||||
|
|
||||||
|
try {
|
||||||
while (true) {
|
while (true) {
|
||||||
char c = read();
|
char c = read();
|
||||||
|
|
||||||
@ -103,6 +104,10 @@ public class EnvironmentParser {
|
|||||||
buffer.append(c);
|
buffer.append(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (EOFException e) {
|
||||||
|
// No terminating newline. bad!
|
||||||
|
return buffer.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String parseQuotedPhrase() throws IOException {
|
private String parseQuotedPhrase() throws IOException {
|
||||||
|
Loading…
Reference in New Issue
Block a user