fixed potential bug with readline
unified Readline line end handling