summaryrefslogtreecommitdiffstats
path: root/88.patch
blob: 9dd01d74bd26b5a51a249a2b79010190de5a04a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From 203b4a30289abf865123f2c23eb4edd4725a0dca Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Wed, 13 Mar 2019 16:15:56 +0100
Subject: [PATCH] Only add bin_dir to PATH if not already there

Fix https://bugs.php.net/75852
---
 PEAR/Builder.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PEAR/Builder.php b/PEAR/Builder.php
index 91348c726..eb5e90e72 100644
--- a/PEAR/Builder.php
+++ b/PEAR/Builder.php
@@ -307,7 +307,9 @@ function build($descfile, $callback = null)
 
         $dir = getcwd();
         $this->log(2, "building in $dir");
-        putenv('PATH=' . $this->config->get('bin_dir') . ':' . getenv('PATH'));
+        if (!preg_match('@(^|:)' . $this->config->get('bin_dir') . '(:|$)@', getenv('PATH'))) {
+            putenv('PATH=' . $this->config->get('bin_dir') . ':' . getenv('PATH'));
+        }
         $err = $this->_runCommand($this->config->get('php_prefix')
                                 . "phpize" .
                                 $this->config->get('php_suffix'),