зеркало из https://github.com/github/putty.git
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:
Родитель
086764f5f4
Коммит
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);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче