From 3670cb6c9683ce3695d7210d9d7cf553e8d7f9e4 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 30 Mar 2022 15:37:47 +0200 Subject: [PATCH] Fix handling of missing HOME env, fixes #10670 --- src/Composer/Config.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Composer/Config.php b/src/Composer/Config.php index 06145cce46c7..24dd88fc5f33 100644 --- a/src/Composer/Config.php +++ b/src/Composer/Config.php @@ -369,9 +369,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];