fix bug which occurs when a target char exists at the head of line.