conf_copy_into must empty the entire target conf before filling it

with the entries from the source one, otherwise add234 will keep
failing ("this key already exists"). Completely broke Plink, ahem.

[originally from svn r9218]
This commit is contained in:
Simon Tatham 2011-07-15 18:18:28 +00:00
Родитель 086764f5f4
Коммит 1aeaff47a9
1 изменённых файлов: 2 добавлений и 0 удалений

2
conf.c
Просмотреть файл

@ -199,6 +199,8 @@ void conf_copy_into(Conf *newconf, Conf *oldconf)
struct conf_entry *entry, *entry2;
int i;
conf_clear(newconf);
for (i = 0; (entry = index234(oldconf->tree, i)) != NULL; i++) {
entry2 = snew(struct conf_entry);
copy_key(&entry2->key, &entry->key);