correct logic when pos is after the string #10467
3 files changed