diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-07 07:52:34 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-07 07:52:34 +0200 |
commit | a51543a3a486ca60018394dda2623fdf1f16a965 (patch) | |
tree | d6d66b3084b7914645318c3dfbf725c764b2dcc8 | |
parent | 7e7e08fb09fdc5769e0a3724757fc5ef313d4233 (diff) | |
download | busybox-w32-a51543a3a486ca60018394dda2623fdf1f16a965.tar.gz busybox-w32-a51543a3a486ca60018394dda2623fdf1f16a965.tar.bz2 busybox-w32-a51543a3a486ca60018394dda2623fdf1f16a965.zip |
reformime: small code and style fixes. no material changes in behavior.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | mailutils/mime.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/mailutils/mime.c b/mailutils/mime.c index 358f4e903..b856c8149 100644 --- a/mailutils/mime.c +++ b/mailutils/mime.c | |||
@@ -232,7 +232,7 @@ static int parse(const char *boundary, char **argv) | |||
232 | // N.B. to avoid false positives let us seek to the _last_ occurance | 232 | // N.B. to avoid false positives let us seek to the _last_ occurance |
233 | p = NULL; | 233 | p = NULL; |
234 | s = line; | 234 | s = line; |
235 | while ((s=strcasestr(s, "Content-Type:")) != NULL) | 235 | while ((s = strcasestr(s, "Content-Type:")) != NULL) |
236 | p = s++; | 236 | p = s++; |
237 | if (!p) | 237 | if (!p) |
238 | goto next; | 238 | goto next; |
@@ -281,8 +281,8 @@ static int parse(const char *boundary, char **argv) | |||
281 | pid = vfork(); | 281 | pid = vfork(); |
282 | if (0 == pid) { | 282 | if (0 == pid) { |
283 | // child reads from fd[0] | 283 | // child reads from fd[0] |
284 | xdup2(fd[0], STDIN_FILENO); | 284 | close(fd[1]); |
285 | close(fd[0]); close(fd[1]); | 285 | xmove_fd(fd[0], STDIN_FILENO); |
286 | xsetenv("CONTENT_TYPE", type); | 286 | xsetenv("CONTENT_TYPE", type); |
287 | xsetenv("CHARSET", charset); | 287 | xsetenv("CHARSET", charset); |
288 | xsetenv("ENCODING", encoding); | 288 | xsetenv("ENCODING", encoding); |
@@ -308,7 +308,8 @@ static int parse(const char *boundary, char **argv) | |||
308 | if (0 == strcasecmp(encoding, "base64")) { | 308 | if (0 == strcasecmp(encoding, "base64")) { |
309 | decode_base64(stdin, fp); | 309 | decode_base64(stdin, fp); |
310 | } else if (0 != strcasecmp(encoding, "7bit") | 310 | } else if (0 != strcasecmp(encoding, "7bit") |
311 | && 0 != strcasecmp(encoding, "8bit")) { | 311 | && 0 != strcasecmp(encoding, "8bit") |
312 | ) { | ||
312 | // quoted-printable, binary, user-defined are unsupported so far | 313 | // quoted-printable, binary, user-defined are unsupported so far |
313 | bb_error_msg_and_die("no support of encoding '%s'", encoding); | 314 | bb_error_msg_and_die("no support of encoding '%s'", encoding); |
314 | } else { | 315 | } else { |
@@ -323,11 +324,15 @@ static int parse(const char *boundary, char **argv) | |||
323 | // no means to truncate what we already have sent to the helper. | 324 | // no means to truncate what we already have sent to the helper. |
324 | p = xmalloc_fgets_str(stdin, "\r\n"); | 325 | p = xmalloc_fgets_str(stdin, "\r\n"); |
325 | while (p) { | 326 | while (p) { |
326 | if ((s = xmalloc_fgets_str(stdin, "\r\n")) == NULL) | 327 | s = xmalloc_fgets_str(stdin, "\r\n"); |
328 | if (s == NULL) | ||
327 | break; | 329 | break; |
328 | if ('-' == s[0] && '-' == s[1] | 330 | if ('-' == s[0] |
329 | && 0 == strncmp(s+2, boundary, boundary_len)) | 331 | && '-' == s[1] |
332 | && 0 == strncmp(s+2, boundary, boundary_len) | ||
333 | ) { | ||
330 | break; | 334 | break; |
335 | } | ||
331 | fputs(p, fp); | 336 | fputs(p, fp); |
332 | p = s; | 337 | p = s; |
333 | } | 338 | } |