浏览代码

I think this fixes the auto update config function when a config file has two similar keys. (reverted from commit 52f1e33052255369852b331fffde30f0dc495f59)

t00thpick1 9 年之前
父节点
当前提交
9bc97c6dd3
共有 1 个文件被更改,包括 2 次插入5 次删除
  1. 2 5
      src/main/java/com/gmail/nossr50/config/AutoUpdateConfigLoader.java

+ 2 - 5
src/main/java/com/gmail/nossr50/config/AutoUpdateConfigLoader.java

@@ -88,11 +88,8 @@ public abstract class AutoUpdateConfigLoader extends ConfigLoader {
 
                 // Dump to the new one
                 for (String key : comments.keySet()) {
-                    if (output.contains(" " + key)) {
-                        output = output.substring(0, output.indexOf(" " + key)) + comments.get(key) + output.substring(output.indexOf(" " + key));
-                    }
-                    if (output.contains("\n" + key)) {
-                        output = output.substring(0, output.indexOf("\n" + key)) + comments.get(key) + output.substring(output.indexOf("\n" + key));
+                    if (output.contains(key)) {
+                        output = output.substring(0, output.indexOf(key)) + comments.get(key) + output.substring(output.indexOf(key));
                     }
                 }
             }