merge fix from https://github.com/composer/composer/pull/8651
merge fix from https://github.com/composer/composer/pull/8651

composer/composer,staabm/composer,naderman/composer,stof/composer,floverdevel/composer,milleruk/composer,pierredup/composer,nicolas-grekas/composer,fabpot/composer,johnstevenson/composer,stefangr/composer,alcohol/composer,localheinz/composer