int output_message (CT, char *);
/* mhshowsbr.c */
-int show_content_aux (CT, int, int, char *, char *);
+int show_content_aux (CT, int, char *, char *);
/* mhmisc.c */
void flush_errors (void);
while (begin >= (off_t) ct->c_begin) {
fseeko (ct->c_fp, begin, SEEK_SET);
while ((bytes_read = fread (buffer, 1, sizeof buffer, ct->c_fp)) > 0) {
- char *end = buffer + bytes_read - 1;
- char *cp;
+ char *cp = rfind_str (buffer, bytes_read, "--");
+
+ if (cp) {
+ char *end;
- if ((cp = rfind_str (buffer, bytes_read, "--"))) {
/* Trim off trailing "--" and anything beyond. */
*cp-- = '\0';
if ((end = rfind_str (buffer, cp - buffer, "\n"))) {
free (cp);
cp = concat (cf, " >", file, NULL);
- status = show_content_aux (ct, 1, 0, cp, NULL);
+ status = show_content_aux (ct, 0, cp, NULL);
free (cp);
/* Unlink decoded content tmp file and free its filename to avoid
c_cefile, c_encoding,
c_digested, c_digest[16], c_ctexbody,
c_ctinitfnx, c_ceopenfnx, c_ceclosefnx, c_cesizefnx,
- c_umask, c_pid, c_rfc934,
+ c_umask, c_rfc934,
c_showproc, c_termproc, c_storeproc, c_storage, c_folder
*/
boundary_in_content (&new_part->c_cefile.ce_fp,
new_part->c_cefile.ce_file,
boundary)) == -1) {
+ free (ct);
return NULL;
}
}
if ((found_boundary = boundary_in_content (&new_part->c_fp,
new_part->c_file,
boundary)) == -1) {
+ free (ct);
return NULL;
}
}
if (found_boundary) {
advise (NULL, "giving up trying to find a unique boundary");
+ free (ct);
return NULL;
}
}