summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2002-03-21 19:12:49 +0000
committerTomas V.V.Cox <cox@php.net>2002-03-21 19:12:49 +0000
commita974fbd9ae3c7c79d6fe4970672261744b9b90c0 (patch)
tree84f28a525016acc053cf7f3898e898ab9660e5b5
parenta188fac946a65f4dcc2c6a0f37b0799d74500741 (diff)
downloadphp-git-a974fbd9ae3c7c79d6fe4970672261744b9b90c0.tar.gz
fix a problem handling nested directories
-rw-r--r--pear/PEAR/Common.php8
1 files 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