mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 06:38:37 -05: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:
parent
086764f5f4
commit
1aeaff47a9
2
conf.c
2
conf.c
@ -199,6 +199,8 @@ void conf_copy_into(Conf *newconf, Conf *oldconf)
|
|||||||
struct conf_entry *entry, *entry2;
|
struct conf_entry *entry, *entry2;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
conf_clear(newconf);
|
||||||
|
|
||||||
for (i = 0; (entry = index234(oldconf->tree, i)) != NULL; i++) {
|
for (i = 0; (entry = index234(oldconf->tree, i)) != NULL; i++) {
|
||||||
entry2 = snew(struct conf_entry);
|
entry2 = snew(struct conf_entry);
|
||||||
copy_key(&entry2->key, &entry->key);
|
copy_key(&entry2->key, &entry->key);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user