projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e31729d
)
Layouting and comment changes. (minor stuff)
author
markus schnalke
<meillo@marmaro.de>
Wed, 8 Feb 2012 08:41:03 +0000
(09:41 +0100)
committer
markus schnalke
<meillo@marmaro.de>
Wed, 8 Feb 2012 08:41:03 +0000
(09:41 +0100)
uip/sendsbr.c
patch
|
blob
|
history
diff --git
a/uip/sendsbr.c
b/uip/sendsbr.c
index
8eb67cc
..
89a0748
100644
(file)
--- a/
uip/sendsbr.c
+++ b/
uip/sendsbr.c
@@
-197,15
+197,16
@@
attach(char *draft_file_name)
has_attachment = 0;
has_attachment = 0;
- while (get_line() != EOF && *field != '\0' && *field != '-')
+ while (get_line() != EOF && *field != '\0' && *field != '-') {
if (strncasecmp(field, attach_hdr, length) == 0 &&
if (strncasecmp(field, attach_hdr, length) == 0 &&
- field[length] == ':')
+ field[length] == ':') {
has_attachment = 1;
has_attachment = 1;
+ }
+ }
/*
/*
- ** We have at least one attachment. Look for at least one
- ** non-blank line in the body of the message which indicates
- ** content in the body.
+ ** Look for at least one non-blank line in the body of the
+ ** message which indicates content in the body.
** Check if body contains at least one non-blank (= not empty)
** and if it contains any non-ASCII chars (= need MIME).
*/
** Check if body contains at least one non-blank (= not empty)
** and if it contains any non-ASCII chars (= need MIME).
*/
@@
-250,8
+251,7
@@
attach(char *draft_file_name)
composition_file = fopen(composition_file_name, "w");
composition_file = fopen(composition_file_name, "w");
- if ((has_body && body_file == (FILE *)0) ||
- composition_file == (FILE *)0) {
+ if ((has_body && !body_file) || !composition_file) {
clean_up_temporary_files();
adios(NULL, "unable to open all of the temporary files.");
}
clean_up_temporary_files();
adios(NULL, "unable to open all of the temporary files.");
}
@@
-262,27
+262,22
@@
attach(char *draft_file_name)
** Then add the dashed line separator.
*/
rewind(draft_file);
** Then add the dashed line separator.
*/
rewind(draft_file);
- while (get_line() != EOF && *field != '\0' && *field != '-')
+ while (get_line() != EOF && *field && *field != '-') {
if (strncasecmp(field, attach_hdr, length) != 0 ||
if (strncasecmp(field, attach_hdr, length) != 0 ||
- field[length] != ':')
+ field[length] != ':') {
fprintf(composition_file, "%s\n", field);
fprintf(composition_file, "%s\n", field);
+ }
+ }
fputs("--------\n", composition_file);
fputs("--------\n", composition_file);
- /*
- ** Copy the message body to a temporary file.
- */
if (has_body) {
if (has_body) {
- while ((c = getc(draft_file)) != EOF)
- putc(c, body_file);
+ /* Copy the message body to the temporary file. */
+ while ((c = getc(draft_file)) != EOF) {
+ putc(c, body_file);
+ }
fclose(body_file);
fclose(body_file);
- }
- /*
- ** Add a mhbuild MIME composition file line for the body if
- ** there was one.
- */
- if (has_body) {
- /* old: make_mime_composition_file_entry(body_file_name); */
+ /* Add a mhbuild MIME composition file line for the body */
/* charset will be discovered/guessed by buildmimeproc */
fprintf(composition_file, "#text/plain %s\n", body_file_name);
}
/* charset will be discovered/guessed by buildmimeproc */
fprintf(composition_file, "#text/plain %s\n", body_file_name);
}
@@
-293,7
+288,7
@@
attach(char *draft_file_name)
** composition file for each.
*/
rewind(draft_file);
** composition file for each.
*/
rewind(draft_file);
- while (get_line() != EOF && *field != '\0' && *field != '-') {
+ while (get_line() != EOF && *field && *field != '-') {
if (strncasecmp(field, attach_hdr, length) == 0 &&
field[length] == ':') {
for (p = field+length+1; *p==' ' || *p=='\t'; p++) {
if (strncasecmp(field, attach_hdr, length) == 0 &&
field[length] == ':') {
for (p = field+length+1; *p==' ' || *p=='\t'; p++) {
@@
-379,6
+374,7
@@
make_mime_composition_file_entry(char *file_name)
content_type = NULL;
content_type = NULL;
+
/*
** Check the file name for a suffix. Scan the context for that
** suffix on a mhshow-suffix- entry. We use these entries to
/*
** Check the file name for a suffix. Scan the context for that
** suffix on a mhshow-suffix- entry. We use these entries to