if (imap_is_magic (f, NULL) == M_IMAP) {
init_state (&state, NULL);
state.imap_browse = 1;
- imap_browse (f, &state);
- strfcpy (LastDir, state.folder, sizeof (LastDir));
+ if (!imap_browse (f, &state))
+ strfcpy (LastDir, state.folder, sizeof (LastDir));
}
else {
#endif