fix #5870, empty SubString had wrong offset