From fd686eb9d48a14768c6cb37e92398e84e65e79a7 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 17 Dec 2004 15:16:04 +0000 Subject: [PATCH] Fix -part option to mhshow/mhlist/mhstore to find sub-parts of the specified part --- ChangeLog | 5 +++++ uip/mhmisc.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) 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; } -- 1.7.10.4