Fixed issue #2234: Config file mess up if not end with LF

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>