Easy advice to give, hard advice to take.
I get it. I'm an optimistic person who believes that people can better themselves, mostly because I make it my goal to better myself. I'm not perfect, never will be, and I know other's have their issues too. You can read my relationship story over in another forum so I'm not going to belabor that point.
Only you can decide where the line is. Sometimes you'll be glad you drew the line, other times you'll be happy you didn't. All you can do is work on yourself in the mean time.