Fixing an infinite loop when there is no newline at the end of the file.
Merge pull request #3 from asolovev/master

Fixing an infinite loop when there is no newline at the end of the file.