10 messages in net.sourceforge.lists.courier-usersRe: [courier-users] [Resend] A small ...
FromSent OnAttachments
ma...@intron.acMay 28, 2006 3:43 am 
Sam VarshavchikMay 28, 2006 6:16 am 
ma...@intron.acMay 28, 2006 10:28 pm.diff
ma...@intron.acMay 30, 2006 10:58 am 
Sam VarshavchikMay 30, 2006 3:24 pm 
Sam VarshavchikMay 30, 2006 6:16 pm 
Alessandro VeselyMay 31, 2006 11:57 pm 
ma...@intron.acJun 1, 2006 4:12 am.diff
Lars AlthofJun 1, 2006 4:38 pm 
Sam VarshavchikJun 1, 2006 5:45 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [courier-users] [Resend] A small patch for some small display problemsActions...
From:ma...@intron.ac (ma@intron.ac)
Date:May 28, 2006 10:28:20 pm
List:net.sourceforge.lists.courier-users
Attachments:

Fixed. See the attachment.

------------------------------------------------------------------------ From Beijing, China Sam Varshavchik wrote:

ma@intron.ac writes:

- else if (strcmp(p, INBOX "." SENT) == 0) + else if (strncmp(p, INBOX "." SENT, strlen(INBOX "." SENT)) == 0) printf("%s", n_sent);

This is wrong. Consider a folder named INBOX.SentLastMonth

--- folder.c.orig Tue Mar 14 07:36:16 2006 +++ folder.c Mon May 29 13:18:45 2006 @@ -1068,7 +1068,7 @@ printf("%s", n_drafts); else if (strcmp(p, INBOX "." TRASH) == 0) printf("%s", n_trash); - else if (strcmp(p, INBOX "." SENT) == 0) + else if (strcmp(p, INBOX "." SENT) == 0 || strcmp(path, SENT) == 0) printf("%s", n_sent); else list_folder(path); @@ -1146,6 +1146,7 @@ size_t i; const char *p; int has_shared=0; + int flag_new_name_buf;

maildir_listfolders(inbox_pfix, homedir, &folders); for (i=0; folders[i]; i++) @@ -1178,6 +1179,7 @@ continue;

p=folders[i]; + flag_new_name_buf=0;

if (strcmp(p, INBOX) == 0) p=folder_inbox; @@ -1185,8 +1187,23 @@ p=folder_drafts; else if (strcmp(p, INBOX "." TRASH) == 0) p=folder_trash; - else if (strcmp(p, INBOX "." SENT) == 0) - p=folder_sent; + else if (strcmp(p, INBOX "." SENT) == 0 + || strncmp(p, INBOX "." SENT ".", strlen(INBOX "." SENT ".")) == 0) + { + char *q; + + q=malloc(strlen(folder_sent)+strlen(p)-strlen(INBOX "." SENT)+1); + strcpy(q, folder_sent); + strcat(q, p+strlen(INBOX "." SENT)); + p=q; + /* We must free newly allocated buffer below. + * Although there's a "continue;" below, if the program goes here, + * it will NOT meet the "continue;". */ + flag_new_name_buf=1; + } + else if(strncmp(p, INBOX ".", strlen(INBOX ".")) == 0) + p+=strlen(INBOX "."); + if (!p) p=folders[i];

if (strncmp(folders[i], SHARED ".", sizeof(SHARED)) == 0) @@ -1222,10 +1239,9 @@ printf("%s.", getarg("PUBLICFOLDERS")); }

- p=strchr(folders[i], '.'); - - list_folder(p ? p+1:folders[i]); + list_folder(p); printf("</option>\n"); + if(flag_new_name_buf) free(p); } maildir_freefolders(&folders); }