handle trailing space in whitespace separated data
fixes #5602