Skip to content

Commit

Permalink
Fix PropertiesUtils space handling during output (#5087)
Browse files Browse the repository at this point in the history
  • Loading branch information
toyknight authored and Tom-Ski committed Mar 5, 2018
1 parent 8159b41 commit 76fe34f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions gdx/src/com/badlogic/gdx/utils/PropertiesUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private PropertiesUtils () {
* compatible with <code>java.util.Properties</code>.
* <p>
* The input stream remains open after this method returns.
*
*
* @param properties the map to be filled.
* @param reader the input character stream reader.
* @throws IOException if an error occurred when reading from the input stream.
Expand Down Expand Up @@ -221,7 +221,7 @@ public static void load (ObjectMap<String, String> properties, Reader reader) th
* <code>=</code>, and <code>:</code> are written with a preceding backslash to ensure that they are properly loaded.
* <p>
* After the entries have been written, the output stream is flushed. The output stream remains open after this method returns.
*
*
* @param properties the {@code ObjectMap}.
* @param writer an output character stream writer.
* @param comment an optional comment to be written, or null.
Expand Down Expand Up @@ -263,7 +263,11 @@ private static void dumpString (StringBuilder outBuffer, String string, boolean
}
switch (ch) {
case ' ':
if (i == 0 || escapeSpace) outBuffer.append("\\ ");
if (i == 0 || escapeSpace) {
outBuffer.append("\\ ");
} else {
outBuffer.append(ch);
}
break;
case '\n':
outBuffer.append("\\n");
Expand Down

0 comments on commit 76fe34f

Please sign in to comment.