From a974fbd9ae3c7c79d6fe4970672261744b9b90c0 Mon Sep 17 00:00:00 2001 From: "Tomas V.V.Cox" Date: Thu, 21 Mar 2002 19:12:49 +0000 Subject: [PATCH] fix a problem handling nested directories --- pear/PEAR/Common.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 -- 2.50.1