Lot's of good advice here, but another thing to keep in mind is that dealing with legacy code can be fun sometimes. It's quite a challenge to deal with and the victories you achieve, even small ones, feel pretty good.
Also meditation is good. Sometimes I get so upset at legacy code that I have to stop and meditate.
Also meditation is good. Sometimes I get so upset at legacy code that I have to stop and meditate.