cvs: pear /Archive_Tar Tar.php

From: Date: Thu, 11 Oct 2001 13:20:11 +0000
Subject: cvs: pear /Archive_Tar Tar.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-976@lists.php.net to get a copy of this message
alexmerz Thu Oct 11 09:20:11 2001 EDT Modified files: /pear/Archive_Tar Tar.php Log: fix a problem with paths under win Index: pear/Archive_Tar/Tar.php diff -u pear/Archive_Tar/Tar.php:1.5 pear/Archive_Tar/Tar.php:1.6 --- pear/Archive_Tar/Tar.php:1.5 Thu Oct 11 07:42:15 2001 +++ pear/Archive_Tar/Tar.php Thu Oct 11 09:20:10 2001 @@ -16,7 +16,7 @@ // | Authors: Vincent Blavet <vincent@blavet.net> | // +----------------------------------------------------------------------+ // -// $Id: Tar.php,v 1.5 2001/10/11 11:42:15 cox Exp $ +// $Id: Tar.php,v 1.6 2001/10/11 13:20:10 alexmerz Exp $ require_once 'PEAR.php'; @@ -24,7 +24,7 @@ * Creates a (compressed) Tar archive * * @author Vincent Blavet <vincent@blavet.net> -* @version $Revision: 1.5 $ +* @version $Revision: 1.6 $ * @package Archive */ class Archive_Tar extends PEAR @@ -735,9 +735,9 @@ $v_result=true; $v_nb = 0; $v_extract_all = true; - $v_listing = false; + $v_listing = false; - if (($p_path == "") || ((substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../"))) + if (($p_path == "") || ((substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../") && (substr(PHP_OS, 0, 3) != 'WIN'))) $p_path = "./".$p_path; // ----- Look for path to remove format (should end by /) @@ -807,11 +807,10 @@ // ----- Look if this file need to be extracted if (($v_extract_file) && (!$v_listing)) - { + { if (($p_remove_path != "") && (substr($v_header[filename], 0, $p_remove_path_size) == $p_remove_path)) $v_header[filename] = substr($v_header[filename], $p_remove_path_size); - if (($p_path != "./") && ($p_path != "/")) { while (substr($p_path, -1) == "/") $p_path = substr($p_path, 0, strlen($p_path)-1); @@ -821,7 +820,6 @@ else $v_header[filename] = $p_path."/".$v_header[filename]; } - if (file_exists($v_header[filename])) { if ((@is_dir($v_header[filename])) && ($v_header[typeflag] == "")) { $this->_error("File '$v_header[filename]' already exists as a directory");

« previous php.pear.cvs (#976) next »