add RTrim to BufWritePre.