Related to a similar fix for config files, where a missing newline character at the end of the file would not read that line: https://www.directadmin.com/features.php?id=2550 the similar read on a string, instead of a file, had the same behavior. Fixed to notice there was buffered data before hitting EOL, and counting it as legitimate before returning.