read correctly if no \n before EOF