AFAICS, the function mangle_libpath fails if a Patch contains multiple sections matching different elements on the manglelist.conf (which is sourced as MANGLE_CANDIDATES in pm_apply):
The return statement is placed right before the done, hence the for loop is run once at most (i.e., it never loops).
But AFAICS, a Patch might deliberately contain multiple sections matching different elements on the manglelist.conf, thus the for loop should iterate through the elements of MANGLE_CANDIDATES.
Am I missing some aspect, or is this really a flaw worth pondering about (i.e., developing an enhancement)?