c4w: sigui: fix dup lines in freshclam.conf (bb #2374).

This commit is contained in:
Török Edvin
2011-01-20 10:57:02 +02:00
parent f2a274670b
commit fa174afe66

View File

@@ -107,6 +107,8 @@ void ConfigEditor::Add(const wxString& key, const wxString &value, bool comment)
if (value.IsEmpty())
return;
wxString writeLine = key + " " + value;
if (comment) {
@@ -123,6 +125,11 @@ void ConfigEditor::Add(const wxString& key, const wxString &value, bool comment)
if (value.find_first_of(" \t\"") != wxString::npos)
writeLine = "\"" + writeLine + "\"";
for (wxString str = file.GetFirstLine(); !file.Eof(); str = file.GetNextLine()) {
if (str.IsSameAs(writeLine))
return;
}
file.InsertLine(writeLine, lastadd);
lastadd++;
}