resolves #167 correctly calculate line length in Ruby 1.8