mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2026-02-07 05:22:03 -05:00
c4w: sigui: fix dup lines in freshclam.conf (bb #2374).
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user