From 37115a224e9f1cfecc5db37285885fe8b2d60964 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 19 Dec 2007 11:16:24 +0000 Subject: Fixed weird problem with zip_open failing with relative path. --- tools/upalyzer/analyze.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/upalyzer/analyze.php b/tools/upalyzer/analyze.php index ff2b365c..d2f8cb2a 100644 --- a/tools/upalyzer/analyze.php +++ b/tools/upalyzer/analyze.php @@ -56,9 +56,9 @@ foreach ($update_file as $update_line) $update_file_maxlen = max($update_file_maxlen, strlen($file)); $entries = array(); - $zip = zip_open($file); + $zip = zip_open(realpath($file)); - if ($zip) { + if ($zip && !is_int($zip)) { while ($zip_entry = zip_read($zip)) { $update['uncompressed_size'] += zip_entry_filesize($zip_entry); $entry_name = zip_entry_name($zip_entry); @@ -81,7 +81,7 @@ foreach ($update_file as $update_line) zip_close($zip); } else { - $update['zip_error'] = true; + $update['zip_error'] = $zip or true; } ksort($entries); @@ -116,7 +116,9 @@ foreach (array_reverse($updates) as $update) $update['used_entry_count'], count($update['entries'])); } else { - printf(" Error!"); + printf(" Error! "); + if (is_int($update['zip_error'])) + echo $update['zip_error']; } echo "\n"; } -- cgit v1.2.3-70-g09d2