diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 2000-08-21 19:25:24 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 2000-08-21 19:25:24 +0000 |
commit | 4f60f24e69acfda2512e84a8f325798efb1062c1 (patch) | |
tree | b28fe68bf90096fa8296daa04365d86e35806dc4 /imap | |
parent | 49e7bc452bd17dfb6fa4e0bfa71a2d1dc117f3c7 (diff) |
patch-bac.parsepath-2
Diffstat (limited to 'imap')
-rw-r--r-- | imap/browse.c | 6 | ||||
-rw-r--r-- | imap/imap.c | 16 |
2 files changed, 9 insertions, 13 deletions
diff --git a/imap/browse.c b/imap/browse.c index 95ef83d6..cfd77c79 100644 --- a/imap/browse.c +++ b/imap/browse.c @@ -311,7 +311,7 @@ static int browse_add_list_result (IMAP_DATA* idata, const char* cmd, if (isparent) noselect = 1; /* prune current folder from output */ - if (isparent || strncmp (name, mx.mbox, strlen (name))) + if (isparent || mutt_strncmp (name, mx.mbox, strlen (name))) imap_add_folder (idata->delim, name, noselect, noinferiors, state, isparent); } @@ -348,8 +348,8 @@ static void imap_add_folder (char delim, char *folder, int noselect, if (isparent) strfcpy (relpath, "../", sizeof (relpath)); /* strip current folder from target, to render a relative path */ - else if (!strncmp (mx.mbox, folder, strlen (mx.mbox))) - strfcpy (relpath, folder + strlen (mx.mbox), sizeof (relpath)); + else if (!mutt_strncmp (mx.mbox, folder, mutt_strlen (mx.mbox))) + strfcpy (relpath, folder + mutt_strlen (mx.mbox), sizeof (relpath)); else strfcpy (relpath, folder, sizeof (relpath)); diff --git a/imap/imap.c b/imap/imap.c index e66878ca..2fbdad7e 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1062,13 +1062,14 @@ int imap_mailbox_check (char* path, int new) connflags = M_IMAP_CONN_NONEW; if (!(idata = imap_conn_find (&(mx.account), connflags))) - goto fail; + { + FREE (&mx.mbox); + return -1; + } conn = idata->conn; imap_fix_path (idata, mx.mbox, buf, sizeof (buf)); - /* Update the path, if it fits */ - if (strlen (buf) < strlen (mx.mbox)) - strcpy (mx.mbox, buf); + FREE (&mx.mbox); imap_munge_mbox_name (mbox, sizeof(mbox), buf); strfcpy (mbox_unquoted, buf, sizeof (mbox_unquoted)); @@ -1092,7 +1093,7 @@ int imap_mailbox_check (char* path, int new) else /* Server does not support STATUS, and this is not the current mailbox. * There is no lightweight way to check recent arrivals */ - goto fail; + return -1; imap_cmd_start (idata, buf); @@ -1128,12 +1129,7 @@ int imap_mailbox_check (char* path, int new) } while (rc == IMAP_CMD_CONTINUE); - FREE (&mx.mbox); return msgcount; - - fail: - FREE (&mx.mbox); - return -1; } /* all this listing/browsing is a mess. I don't like that name is a pointer |