From 7c9356955e3406c1ab2706f966992b66320ab560 Mon Sep 17 00:00:00 2001 From: GJ Date: Mon, 30 Sep 2013 16:17:44 -0400 Subject: [PATCH] ACTUALLY handle SQL passwords (or other fields) with '#' in them properly. --- .../java/com/gmail/nossr50/config/AutoUpdateConfigLoader.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/AutoUpdateConfigLoader.java b/src/main/java/com/gmail/nossr50/config/AutoUpdateConfigLoader.java index be8cb5e74..3d090b494 100644 --- a/src/main/java/com/gmail/nossr50/config/AutoUpdateConfigLoader.java +++ b/src/main/java/com/gmail/nossr50/config/AutoUpdateConfigLoader.java @@ -63,7 +63,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader { output = output.replace(" ", " "); // Rip out Bukkit's attempt to save comments at the top of the file - while (output.indexOf('#') != -1) { + while (!output.startsWith("General:")) { output = output.substring(output.indexOf('\n', output.indexOf('#')) + 1); } @@ -76,7 +76,7 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader { String line; while ((line = reader.readLine()) != null) { - if (line.contains("#") && !line.contains("User_Password:")) { + if (line.contains("#")) { temp += line + "\n"; } else if (line.contains(":")) {