Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57372 - website/public_html/beta/common/code
From: daniel_james_at_[hidden]
Date: 2009-11-04 13:09:17


Author: danieljames
Date: 2009-11-04 13:09:15 EST (Wed, 04 Nov 2009)
New Revision: 57372
URL: http://svn.boost.org/trac/boost/changeset/57372

Log:
Add an error message to the unzip 404 page.
Text files modified:
   website/public_html/beta/common/code/boost_archive.php | 10 +++++++---
   1 files changed, 7 insertions(+), 3 deletions(-)

Modified: website/public_html/beta/common/code/boost_archive.php
==============================================================================
--- website/public_html/beta/common/code/boost_archive.php (original)
+++ website/public_html/beta/common/code/boost_archive.php 2009-11-04 13:09:15 EST (Wed, 04 Nov 2009)
@@ -129,12 +129,13 @@
         while ($file_handle && !feof($file_handle)) {
             $text .= fread($file_handle,8*1024);
         }
- if(pclose($file_handle) == 0) {
+ $exit_status = pclose($file_handle);
+ if($exit_status == 0) {
             return $text;
         }
         else {
             $this->extractor_ = '404';
- return '';
+ return unzip_error($exit_status);
         }
     }
 
@@ -529,6 +530,9 @@
         # error in those cases.
 
         print '<h1>404 Not Found</h1><p>File "' . $this->file_ . '"not found.</p>';
+ if($this->content_) {
+ print '<p>Unzip error: '.htmlentities($this->content_).'</p>';
+ }
     }
 }
 
@@ -544,7 +548,7 @@
     case 5: return 'Unzip was unable to allocate memory or unable to obtain a tty to read the decryption password(s).';
     case 6: return 'Unzip was unable to allocate memory during decompression to disk.';
     case 7: return 'Unzip was unable to allocate memory during in-memory decompression.';
- case 9: return 'The specified zipfiles were not found.';
+ case 9: return 'The specified zipfile was not found.';
     case 10: return 'Invalid options were specified on the command line.';
     case 11: return 'No matching files were found.';
     case 50: return 'The disk is (or was) full during extraction.';


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk