]> granicus.if.org Git - php/commitdiff
fix a problem handling nested directories
authorTomas V.V.Cox <cox@php.net>
Thu, 21 Mar 2002 19:12:49 +0000 (19:12 +0000)
committerTomas V.V.Cox <cox@php.net>
Thu, 21 Mar 2002 19:12:49 +0000 (19:12 +0000)
pear/PEAR/Common.php

index 929a97917ecc73ac84cf95e944e3b6426426084e..ddcd4e46048938f39ed8e5d29e9b803d23819d83 100644 (file)
@@ -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