François fixed _lp_dirtrim, from upstream