af64e565d7
Introduced #6750, reported by @Langbart, and quite hard to do right. Fixes #6750 This was SVN commit r27567.