textonly: walk multipart parts recursively
Replace the flat part loop with its manual boundary stack by a recursive
walk_level(): each level processes its parts, recurses into nested
multipart wrappers, and emits the first text/plain leaf found in the
subtree. The boundary array is allocated once in process_mbox() and
passed down with the current depth; a level reports the boundary it
stopped at so an ancestor delimiter unwinds cleanly. Part-header parsing
moves into read_part_hdrs(). This removes the inline nested-multipart
sub-block that pushed a boundary mid-header-read and flattened recursion
onto the stack.
1 file changed