mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00
fix Bug #13786 on unix (Steph can you verify?)
This commit is contained in:
parent
791bb5db46
commit
d16f86f528
2 changed files with 10 additions and 5 deletions
|
@ -8,6 +8,7 @@ phar.readonly=0
|
|||
--FILE--
|
||||
<?php
|
||||
|
||||
try {
|
||||
for ($i = 0; $i < 2; $i++) {
|
||||
$fname = "DataArchive.phar";
|
||||
$path = dirname(__FILE__) . DIRECTORY_SEPARATOR . $fname;
|
||||
|
@ -19,12 +20,13 @@ for ($i = 0; $i < 2; $i++) {
|
|||
}
|
||||
|
||||
echo("\nWritten files: $i\n");
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage() . "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
--EXPECTF--
|
||||
string(26) "file 0 in DataArchive.phar"
|
||||
string(26) "file 1 in DataArchive.phar"
|
||||
|
||||
Written files: 2
|
||||
unable to seek to start of file "0" while creating new phar "%sDataArchive.phar"
|
||||
===DONE===
|
|
@ -104,6 +104,9 @@ int phar_seek_efp(phar_entry_info *entry, off_t offset, int whence, off_t positi
|
|||
php_stream *fp = phar_get_efp(entry, follow_links TSRMLS_CC);
|
||||
off_t temp;
|
||||
|
||||
if (!fp) {
|
||||
return -1;
|
||||
}
|
||||
if (follow_links) {
|
||||
phar_entry_info *t;
|
||||
t = phar_get_link_source(entry TSRMLS_CC);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue