From: Oliver Kiddle Date: Fri, 17 Dec 2004 15:16:04 +0000 (+0000) Subject: Fix -part option to mhshow/mhlist/mhstore to find sub-parts of the specified X-Git-Tag: RELEASE_1_2~53 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=fd686eb9d48a14768c6cb37e92398e84e65e79a7;p=mmh Fix -part option to mhshow/mhlist/mhstore to find sub-parts of the specified part --- diff --git a/ChangeLog b/ChangeLog index 48a5ee1..b29df86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-12-17 Oliver Kiddle + + * uip/mhmisc.c Fix -part option to mhshow/mhlist/mhstore to + find sub-parts of the specified part + 2003-9-30 Glenn Burkhardt * Fix 'pick' so handling of options "-list" and "-seq" are independent. diff --git a/uip/mhmisc.c b/uip/mhmisc.c index 825ec87..a3da759 100644 --- a/uip/mhmisc.c +++ b/uip/mhmisc.c @@ -45,13 +45,17 @@ int part_ok (CT ct, int sP) { char **ap; + int len; if (npart == 0 || (ct->c_type == CT_MULTIPART && (sP || ct->c_subtype))) return 1; - for (ap = parts; *ap; ap++) - if (!strcmp (*ap, ct->c_partno)) - return 1; + for (ap = parts; *ap; ap++) { + len = strlen(*ap); + if (!strncmp (*ap, ct->c_partno, len) && + (!ct->c_partno[len] || ct->c_partno[len] == '.' )) + return 1; + } return 0; }