Patches all the way down, it seems. I've had to deal with similar codebases. I try to fix what I can, but it always seems to be a neverending process.
Legacy codebases suck, but it doesn't stop newer codebases from sucking just as much. I've learnt that the hard way.