"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libs/sqwebmail/autoresponse.c" between
sqwebmail-5.9.3.tar.bz2 and sqwebmail-6.0.0.tar.bz2

About: SqWebMail is a CGI Webmail client for Maildir mailboxes (module of the Courier mail server).

autoresponse.c  (sqwebmail-5.9.3.tar.bz2):autoresponse.c  (sqwebmail-6.0.0.tar.bz2)
skipping to change at line 75 skipping to change at line 75
const char *autoresp_title2=getarg("TITLE2"); const char *autoresp_title2=getarg("TITLE2");
const char *autoresp_text1=getarg("TEXT1"); const char *autoresp_text1=getarg("TEXT1");
const char *autoresp_text2=getarg("TEXT2"); const char *autoresp_text2=getarg("TEXT2");
if ( *cgi("do.newautoresp")) if ( *cgi("do.newautoresp"))
{ {
const char *name=cgi("newname"); const char *name=cgi("newname");
char *p; char *p;
FILE *fp; FILE *fp;
p=folder_toutf7(name); p=folder_toutf8(name);
if (!p || maildir_autoresponse_validate(NULL, p)) if (!p || maildir_autoresponse_validate(NULL, p))
{ {
free(p); free(p);
printf("%s", getarg("BADNAME")); printf("%s", getarg("BADNAME"));
return; return;
} }
if ((fp=maildir_autoresponse_open(NULL, p)) != NULL) if ((fp=maildir_autoresponse_open(NULL, p)) != NULL)
{ {
skipping to change at line 110 skipping to change at line 110
getarg("UPLOAD")); getarg("UPLOAD"));
printf("<input type=\"submit\" name=\"do.autorespcreate\"" printf("<input type=\"submit\" name=\"do.autorespcreate\""
" value=\"%s\" />", getarg("SAVE")); " value=\"%s\" />", getarg("SAVE"));
return; return;
} }
if ( *cgi("do.autorespedit")) if ( *cgi("do.autorespedit"))
{ {
const char *autorespname=cgi("autoresponse_choose"); const char *autorespname=cgi("autoresponse_choose");
FILE *fp; FILE *fp;
char *s=folder_fromutf7(autorespname); char *s=folder_fromutf8(autorespname);
const char *pp; const char *pp;
if (!s) if (!s)
{ {
printf(getarg("ERROR"), strerror(errno)); printf(getarg("ERROR"), strerror(errno));
return; return;
} }
pp=cgi("replytext"); pp=cgi("replytext");
skipping to change at line 285 skipping to change at line 285
} }
return; return;
} }
if ( *cgi("do.autorespdelete")) if ( *cgi("do.autorespdelete"))
{ {
const char *autorespname=cgi("autoresponse_choose"); const char *autorespname=cgi("autoresponse_choose");
if (mailfilter_autoreplyused(autorespname)) if (mailfilter_autoreplyused(autorespname))
{ {
char *s=folder_fromutf7(autorespname); char *s=folder_fromutf8(autorespname);
printf(getarg("INUSE"), s ? s:""); printf(getarg("INUSE"), s ? s:"");
if (s) if (s)
free(s); free(s);
} }
else else
maildir_autoresponse_delete(NULL, autorespname); maildir_autoresponse_delete(NULL, autorespname);
return; return;
} }
} }
skipping to change at line 389 skipping to change at line 389
if (fflush(uai->fp) || ferror(uai->fp) if (fflush(uai->fp) || ferror(uai->fp)
|| fseek(uai->fp, 0L, SEEK_SET) < 0) || fseek(uai->fp, 0L, SEEK_SET) < 0)
{ {
fclose(uai->fp); fclose(uai->fp);
enomem(); enomem();
} }
mimetype=calc_mime_type(uai->filename); mimetype=calc_mime_type(uai->filename);
if (strcasecmp(mimetype, "message/rfc822") == 0) if (rfc2045_message_content_type(mimetype))
{ {
/* Magic */ /* Magic */
afp=maildir_autoresponse_create(NULL, uai->autorespname); afp=maildir_autoresponse_create(NULL, uai->autorespname);
if (!afp) if (!afp)
{ {
fclose(uai->fp); fclose(uai->fp);
enomem(); enomem();
} }
skipping to change at line 540 skipping to change at line 540
if (putc(c, o) == EOF) if (putc(c, o) == EOF)
return (-1); return (-1);
return (0); return (0);
} }
static int comp_autorespname(const void *a, const void *b) static int comp_autorespname(const void *a, const void *b)
{ {
const char *ca=*(const char **)a; const char *ca=*(const char **)a;
const char *cb=*(const char **)b; const char *cb=*(const char **)b;
char *sa=folder_fromutf7(ca); char *sa=folder_fromutf8(ca);
char *sb=folder_fromutf7(cb); char *sb=folder_fromutf8(cb);
int i=sa && sb ? strcoll(sa, sb):0; int i=sa && sb ? strcoll(sa, sb):0;
free(sa); free(sa);
free(sb); free(sb);
return (i); return (i);
} }
void autoresponselist() void autoresponselist()
{ {
skipping to change at line 574 skipping to change at line 574
qsort(list, i, sizeof(list[0]), &comp_autorespname); qsort(list, i, sizeof(list[0]), &comp_autorespname);
for (i=0; list[i]; i++) for (i=0; list[i]; i++)
{ {
char *s; char *s;
printf("<option value=\""); printf("<option value=\"");
output_attrencoded(list[i]); output_attrencoded(list[i]);
printf("\">"); printf("\">");
s=folder_fromutf7(list[i]); s=folder_fromutf8(list[i]);
output_attrencoded(s); output_attrencoded(s);
printf("</option>"); printf("</option>");
free(s); free(s);
} }
maildir_autoresponse_list_free(list); maildir_autoresponse_list_free(list);
} }
void autoresponsepick() void autoresponsepick()
{ {
skipping to change at line 609 skipping to change at line 609
for (i=0; list[i]; i++) for (i=0; list[i]; i++)
{ {
char *s; char *s;
printf("<option%s value=\"", printf("<option%s value=\"",
strcmp(choice, list[i]) ? "":" selected='selected'"); strcmp(choice, list[i]) ? "":" selected='selected'");
output_attrencoded(list[i]); output_attrencoded(list[i]);
printf("\">"); printf("\">");
s=folder_fromutf7(list[i]); s=folder_fromutf8(list[i]);
output_attrencoded(s); output_attrencoded(s);
printf("</option>"); printf("</option>");
free(s); free(s);
} }
maildir_autoresponse_list_free(list); maildir_autoresponse_list_free(list);
} }
 End of changes. 7 change blocks. 
8 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)