10 messages in net.sourceforge.lists.courier-users[courier-users] [Resend] A small patc...
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:[courier-users] [Resend] A small patch for some small display problemsActions...
From:ma...@intron.ac (ma@intron.ac)
Date:May 28, 2006 3:43:26 am
List:net.sourceforge.lists.courier-users

It seems that my last mail has been taken as junk. The mail with an attachment failed to enter mailing list.

Hunk @@ -1068,7 +1068,7 @@

Translate folder name like ".Sent.*" when form=folders.

Hunks @@ -1146,6 +1146,7 @@ @@ -1178,6 +1179,7 @@ @@ -1185,8 +1187,22 @@ @@ -1222,10 +1238,9 @@ (Only "if(flag_new_name_buf) free(p);"

Translate folder name in drop-down list when form=readmsg.

Hunk @@ -1222,10 +1238,9 @@ (Only "list_folder(p);"

Display translated folder name in drop-down list. Since I have dealt with "Inbox.*" in hunk @@ -1185,8 +1187,22 @@, here we needn't skip the first "." again. What's more, the pointer "p" probably points to a newly allocated buffer (See the hunk @@ -1185,8 +1187,22 @@), and it must be kept until the buffer is freed.

--- folder.c.orig Tue Mar 14 07:36:16 2006 +++ folder.c Sun May 28 02:27:06 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 (strncmp(p, INBOX "." SENT, strlen(INBOX "." 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,22 @@ 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 (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 +1238,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); }

------------------------------------------------------------------------ From Beijing, China