X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/9f7ebadc564a72c01e28dd895d88e171e7952fe7..1c51badd393b183d62b45a9a83db56e0b0601086:/windows/windlg.c diff --git a/windows/windlg.c b/windows/windlg.c index 3a9d6e57..beedeb2c 100644 --- a/windows/windlg.c +++ b/windows/windlg.c @@ -322,7 +322,7 @@ static HTREEITEM treeview_insert(struct treeview_faff *faff, newitem = TreeView_InsertItem(faff->treeview, &ins); if (level > 0) TreeView_Expand(faff->treeview, faff->lastat[level - 1], - TVE_EXPAND); + (level > 1 ? TVE_COLLAPSE : TVE_EXPAND)); faff->lastat[level] = newitem; for (i = level + 1; i < 4; i++) faff->lastat[i] = NULL; @@ -786,7 +786,7 @@ int verify_ssh_host_key(void *frontend, char *host, int port, char *keytype, if (ret == 0) /* success - key matched OK */ return 1; - if (ret == 2) { /* key was different */ + else if (ret == 2) { /* key was different */ int mbret; char *text = dupprintf(wrongmsg, appname, keytype, fingerprint, appname); @@ -802,9 +802,7 @@ int verify_ssh_host_key(void *frontend, char *host, int port, char *keytype, return 1; } else if (mbret == IDNO) return 1; - return 0; - } - if (ret == 1) { /* key was absent */ + } else if (ret == 1) { /* key was absent */ int mbret; char *text = dupprintf(absentmsg, keytype, fingerprint, appname); char *caption = dupprintf(mbtitle, appname); @@ -819,8 +817,8 @@ int verify_ssh_host_key(void *frontend, char *host, int port, char *keytype, return 1; } else if (mbret == IDNO) return 1; - return 0; } + return 0; /* abandon the connection */ } /*