1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00

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
parent 086764f5f4
commit 1aeaff47a9

2
conf.c
View File

@ -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);