the second argument hasn't been used since "historical" times.
also add some commentary to part_ok().
/* mhmisc.c */
-int part_ok (CT, int);
+int part_ok (CT);
int type_ok (CT, int);
void content_error (char *, CT, char *, ...);
void flush_errors (void);
CT parse_mime (char *);
/* mhmisc.c */
-int part_ok (CT, int);
+int part_ok (CT);
int type_ok (CT, int);
void flush_errors (void);
#include <h/utils.h>
/* mhmisc.c */
-int part_ok (CT, int);
+int part_ok (CT);
int type_ok (CT, int);
void flush_errors (void);
for (part = m->mp_parts; part; part = part->mp_next) {
CT p = part->mp_part;
- if (part_ok (p, 1) && type_ok (p, 1))
+ if (part_ok (p) && type_ok (p, 1))
list_switch (p, 0, realsize, verbose, debug, dispo);
}
/*
* prototypes
*/
-int part_ok (CT, int);
+int part_ok (CT);
int type_ok (CT, int);
void content_error (char *, CT, char *, ...);
void flush_errors (void);
int
-part_ok (CT ct, int sP)
+part_ok (CT ct)
{
char **ap;
int len;
- if (npart == 0 || (ct->c_type == CT_MULTIPART && (sP || ct->c_subtype)))
+ /* a part is "ok", i.e., should be processed, if:
+ - there were no -part arguments
+ - this part is a multipart
+ */
+ if (npart == 0 || ct->c_type == CT_MULTIPART) {
return 1;
+ }
+ /* or if:
+ - this part is a an exact match for any -part option
+ - this part is a sub-part of any -part option
+ */
for (ap = parts; *ap; ap++) {
len = strlen(*ap);
if (!strncmp (*ap, ct->c_partno, len) &&
- (!ct->c_partno[len] || ct->c_partno[len] == '.' ))
+ (!ct->c_partno[len] || ct->c_partno[len] == '.' )) {
return 1;
+ }
}
return 0;
CT parse_mime (char *);
/* mhmisc.c */
-int part_ok (CT, int);
+int part_ok (CT);
int type_ok (CT, int);
void flush_errors (void);
int find_cache (CT, int, int *, char *, char *, int);
/* mhmisc.c */
-int part_ok (CT, int);
+int part_ok (CT);
int type_ok (CT, int);
void content_error (char *, CT, char *, ...);
CT parse_mime (char *);
/* mhmisc.c */
-int part_ok (CT, int);
+int part_ok (CT);
int type_ok (CT, int);
void flush_errors (void);
/* mhmisc.c */
-int part_ok (CT, int);
+int part_ok (CT);
int type_ok (CT, int);
void content_error (char *, CT, char *, ...);
void flush_errors (void);
for (part = m->mp_parts; part; part = part->mp_next) {
p = part->mp_part;
- if (part_ok (p, 1) && type_ok (p, 1)) {
+ if (part_ok (p) && type_ok (p, 1)) {
int inneresult;
request_matched = 1;
CT parse_mime (char *);
/* mhmisc.c */
-int part_ok (CT, int);
+int part_ok (CT);
int type_ok (CT, int);
void flush_errors (void);
/* mhmisc.c */
-int part_ok (CT, int);
+int part_ok (CT);
int type_ok (CT, int);
void flush_errors (void);
for (part = m->mp_parts; part; part = part->mp_next) {
CT p = part->mp_part;
- if (part_ok (p, 1) && type_ok (p, 1)) {
+ if (part_ok (p) && type_ok (p, 1)) {
if (ct->c_storage) {
/* Support mhstore -outfile. The MIME parser doesn't
load c_storage, so we know that p->c_storage is