fix Bug #13786 on unix (Steph can you verify?)

This commit is contained in:
Greg Beaver 2008-04-30 22:16:25 +00:00
parent 791bb5db46
commit d16f86f528
2 changed files with 10 additions and 5 deletions

View file

@ -8,6 +8,7 @@ phar.readonly=0
--FILE-- --FILE--
<?php <?php
try {
for ($i = 0; $i < 2; $i++) { for ($i = 0; $i < 2; $i++) {
$fname = "DataArchive.phar"; $fname = "DataArchive.phar";
$path = dirname(__FILE__) . DIRECTORY_SEPARATOR . $fname; $path = dirname(__FILE__) . DIRECTORY_SEPARATOR . $fname;
@ -19,12 +20,13 @@ for ($i = 0; $i < 2; $i++) {
} }
echo("\nWritten files: $i\n"); echo("\nWritten files: $i\n");
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}
?> ?>
===DONE=== ===DONE===
--EXPECT-- --EXPECTF--
string(26) "file 0 in DataArchive.phar" string(26) "file 0 in DataArchive.phar"
string(26) "file 1 in DataArchive.phar" unable to seek to start of file "0" while creating new phar "%sDataArchive.phar"
===DONE===
Written files: 2
===DONE===

View file

@ -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); php_stream *fp = phar_get_efp(entry, follow_links TSRMLS_CC);
off_t temp; off_t temp;
if (!fp) {
return -1;
}
if (follow_links) { if (follow_links) {
phar_entry_info *t; phar_entry_info *t;
t = phar_get_link_source(entry TSRMLS_CC); t = phar_get_link_source(entry TSRMLS_CC);