forward port Alex Badea's gline patch from 2.10.11