Skip to content

Commit

Permalink
Fix handling of missing HOME env, fixes #10670
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Mar 30, 2022
1 parent ccfbc16 commit 2bd524f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Composer/Config.php
Expand Up @@ -374,9 +374,7 @@ public function get(string $key, int $flags = 0)
return (int) $this->config['cache-ttl'];

case 'home':
$val = Preg::replace('#^(\$HOME|~)(/|$)#', rtrim(Platform::getEnv('HOME') ?: Platform::getEnv('USERPROFILE'), '/\\') . '/', $this->config[$key]);

return rtrim($this->process($val, $flags), '/\\');
return rtrim($this->process(Platform::expandPath($this->config[$key]), $flags), '/\\');

case 'bin-compat':
$value = $this->getComposerEnv('COMPOSER_BIN_COMPAT') ?: $this->config[$key];
Expand Down

0 comments on commit 2bd524f

Please sign in to comment.