From: Tomas V.V.Cox Date: Thu, 21 Mar 2002 19:12:49 +0000 (+0000) Subject: fix a problem handling nested directories X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~1151 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a974fbd9ae3c7c79d6fe4970672261744b9b90c0;p=php fix a problem handling nested directories --- diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php index 929a97917e..ddcd4e4604 100644 --- a/pear/PEAR/Common.php +++ b/pear/PEAR/Common.php @@ -142,11 +142,8 @@ class PEAR_Common extends PEAR $this->cdata = ''; switch ($name) { case 'dir': - if (isset($this->dir_names)) { + if ($attribs['name'] != '/') { $this->dir_names[] = $attribs['name']; - } else { - // Don't add the root dir - $this->dir_names = array(); } if (isset($attribs['baseinstalldir'])) { $this->dir_install = $attribs['baseinstalldir']; @@ -278,7 +275,7 @@ class PEAR_Common extends PEAR case 'file': $this->current_file = $data; $path = ''; - if (!empty($this->dir_names)) { + if (count($this->dir_names)) { foreach ($this->dir_names as $dir) { $path .= $dir . DIRECTORY_SEPARATOR; } @@ -370,6 +367,7 @@ class PEAR_Common extends PEAR $this->destdir = ''; $this->pkginfo['filelist'] = array(); $this->filelist =& $this->pkginfo['filelist']; + $this->dir_names = array(); $this->in_changelog = false; // read the whole thing so we only get one cdata callback