Fix checking for newline on end of file by properly checking the last byte of the file if the file is non empty.
Fix checking for newline on end of file by properly checking the last byte of the file if the file is non empty.

saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt