-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sam Tuke
committed
Oct 16, 2012
1 parent
06ea9c1
commit 8b01286
Showing
3,169 changed files
with
191,827 additions
and
253,859 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,12 @@ _darcs/* | |
CVS/* | ||
.svn/* | ||
RCS/* | ||
*.backup* | ||
|
||
# kdevelop | ||
.kdev | ||
*.kdev4 | ||
*.kate-swp | ||
|
||
# Lokalize | ||
*lokalize* | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ | |
* @author Vincent Blavet <[email protected]> | ||
* @copyright 1997-2010 The Authors | ||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | ||
* @version CVS: $Id: Tar.php 323476 2012-02-24 15:27:26Z mrook $ | ||
* @version CVS: $Id: Tar.php 324840 2012-04-05 08:44:41Z mrook $ | ||
* @link http://pear.php.net/package/Archive_Tar | ||
*/ | ||
|
||
|
@@ -50,7 +50,7 @@ | |
* @package Archive_Tar | ||
* @author Vincent Blavet <[email protected]> | ||
* @license http://www.opensource.org/licenses/bsd-license.php New BSD License | ||
* @version $Revision: 323476 $ | ||
* @version $Revision: 324840 $ | ||
*/ | ||
class Archive_Tar extends PEAR | ||
{ | ||
|
@@ -577,7 +577,7 @@ function setAttribute() | |
} | ||
|
||
// ----- Get the arguments | ||
$v_att_list = func_get_args(); | ||
$v_att_list = &func_get_args(); | ||
|
||
// ----- Read the attributes | ||
$i=0; | ||
|
@@ -649,14 +649,14 @@ function setIgnoreList($list) | |
// {{{ _error() | ||
function _error($p_message) | ||
{ | ||
$this->error_object = $this->raiseError($p_message); | ||
$this->error_object = &$this->raiseError($p_message); | ||
} | ||
// }}} | ||
|
||
// {{{ _warning() | ||
function _warning($p_message) | ||
{ | ||
$this->error_object = $this->raiseError($p_message); | ||
$this->error_object = &$this->raiseError($p_message); | ||
} | ||
// }}} | ||
|
||
|
@@ -981,7 +981,7 @@ function _addList($p_list, $p_add_dir, $p_remove_dir) | |
// }}} | ||
|
||
// {{{ _addFile() | ||
function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir,$v_stored_filename=null) | ||
function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $v_stored_filename=null) | ||
{ | ||
if (!$this->_file) { | ||
$this->_error('Invalid file descriptor'); | ||
|
@@ -992,31 +992,32 @@ function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir,$v_stored_f | |
$this->_error('Invalid file name'); | ||
return false; | ||
} | ||
if(is_null($v_stored_filename)){ | ||
|
||
// ----- Calculate the stored filename | ||
$p_filename = $this->_translateWinPath($p_filename, false); | ||
$v_stored_filename = $p_filename; | ||
if (strcmp($p_filename, $p_remove_dir) == 0) { | ||
return true; | ||
} | ||
if ($p_remove_dir != '') { | ||
if (substr($p_remove_dir, -1) != '/') | ||
$p_remove_dir .= '/'; | ||
|
||
if (substr($p_filename, 0, strlen($p_remove_dir)) == $p_remove_dir) | ||
$v_stored_filename = substr($p_filename, strlen($p_remove_dir)); | ||
} | ||
$v_stored_filename = $this->_translateWinPath($v_stored_filename); | ||
if ($p_add_dir != '') { | ||
if (substr($p_add_dir, -1) == '/') | ||
$v_stored_filename = $p_add_dir.$v_stored_filename; | ||
else | ||
$v_stored_filename = $p_add_dir.'/'.$v_stored_filename; | ||
} | ||
|
||
$v_stored_filename = $this->_pathReduction($v_stored_filename); | ||
} | ||
|
||
// ownCloud change to make it possible to specify the filename to use | ||
if(is_null($v_stored_filename)) { | ||
// ----- Calculate the stored filename | ||
$p_filename = $this->_translateWinPath($p_filename, false); | ||
$v_stored_filename = $p_filename; | ||
if (strcmp($p_filename, $p_remove_dir) == 0) { | ||
return true; | ||
} | ||
if ($p_remove_dir != '') { | ||
if (substr($p_remove_dir, -1) != '/') | ||
$p_remove_dir .= '/'; | ||
|
||
if (substr($p_filename, 0, strlen($p_remove_dir)) == $p_remove_dir) | ||
$v_stored_filename = substr($p_filename, strlen($p_remove_dir)); | ||
} | ||
$v_stored_filename = $this->_translateWinPath($v_stored_filename); | ||
if ($p_add_dir != '') { | ||
if (substr($p_add_dir, -1) == '/') | ||
$v_stored_filename = $p_add_dir.$v_stored_filename; | ||
else | ||
$v_stored_filename = $p_add_dir.'/'.$v_stored_filename; | ||
} | ||
|
||
$v_stored_filename = $this->_pathReduction($v_stored_filename); | ||
} | ||
|
||
if ($this->_isArchive($p_filename)) { | ||
if (($v_file = @fopen($p_filename, "rb")) == 0) { | ||
|
@@ -1775,12 +1776,20 @@ function _openAppend() | |
} | ||
|
||
if ($this->_compress_type == 'gz') { | ||
$end_blocks = 0; | ||
|
||
while (!@gzeof($v_temp_tar)) { | ||
$v_buffer = @gzread($v_temp_tar, 512); | ||
if ($v_buffer == ARCHIVE_TAR_END_BLOCK || strlen($v_buffer) == 0) { | ||
$end_blocks++; | ||
// do not copy end blocks, we will re-make them | ||
// after appending | ||
continue; | ||
} elseif ($end_blocks > 0) { | ||
for ($i = 0; $i < $end_blocks; $i++) { | ||
$this->_writeBlock(ARCHIVE_TAR_END_BLOCK); | ||
} | ||
$end_blocks = 0; | ||
} | ||
$v_binary_data = pack("a512", $v_buffer); | ||
$this->_writeBlock($v_binary_data); | ||
|
@@ -1789,9 +1798,19 @@ function _openAppend() | |
@gzclose($v_temp_tar); | ||
} | ||
elseif ($this->_compress_type == 'bz2') { | ||
$end_blocks = 0; | ||
|
||
while (strlen($v_buffer = @bzread($v_temp_tar, 512)) > 0) { | ||
if ($v_buffer == ARCHIVE_TAR_END_BLOCK) { | ||
if ($v_buffer == ARCHIVE_TAR_END_BLOCK || strlen($v_buffer) == 0) { | ||
$end_blocks++; | ||
// do not copy end blocks, we will re-make them | ||
// after appending | ||
continue; | ||
} elseif ($end_blocks > 0) { | ||
for ($i = 0; $i < $end_blocks; $i++) { | ||
$this->_writeBlock(ARCHIVE_TAR_END_BLOCK); | ||
} | ||
$end_blocks = 0; | ||
} | ||
$v_binary_data = pack("a512", $v_buffer); | ||
$this->_writeBlock($v_binary_data); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.