From ce4ef560e274be0dcae43499acff2abd83b30af3 Mon Sep 17 00:00:00 2001 From: luca0N! Date: Mon, 28 Jun 2021 15:36:37 -0300 Subject: [PATCH] Fixed data loss bug Fixed a bug which made Dual remove lines that start with a comment in the hosts file. --- src/com/luca0n/dual/common/Dual.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/luca0n/dual/common/Dual.java b/src/com/luca0n/dual/common/Dual.java index 42b2dfb..842ff22 100644 --- a/src/com/luca0n/dual/common/Dual.java +++ b/src/com/luca0n/dual/common/Dual.java @@ -155,9 +155,12 @@ public class Dual { String line = lines[x]; boolean keepLine = true; // Check if this line is a comment. - if (line.startsWith("#")) - // Ignore this line. + if (line.startsWith("#")){ + // Ignore this line, but add it to the updatedLines list + // in order to avoid data loss. + updatedLines.add(line); continue; + } String[] contents = line.split("#"); // Check if this line was auto-generated by this program.