Index: Exception.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/Exception.cc,v retrieving revision 2.2 diff -u -p -r2.2 Exception.cc --- Exception.cc 10 Nov 2002 03:40:36 -0000 2.2 +++ Exception.cc 16 Feb 2003 13:13:06 -0000 @@ -19,10 +19,16 @@ Exception::Exception (char const *where, { } +Exception::Exception (char const *where, const String &message, int _appErrNo) + : appErrNo (_appErrNo) +{ + _message = message; +} + char const * Exception::what() const throw() { - return _message; + return _message.cstr_oneuse (); } int Index: Exception.h =================================================================== RCS file: /cvs/cygwin-apps/setup/Exception.h,v retrieving revision 2.2 diff -u -p -r2.2 Exception.h --- Exception.h 10 Nov 2002 03:40:36 -0000 2.2 +++ Exception.h 16 Feb 2003 13:13:07 -0000 @@ -21,15 +21,18 @@ #define _EXCEPTION_H_ #include +#include "String++.h" /* Generic excpetion class for throwing exceptions */ class Exception : public std::exception { public: Exception (char const *where, char const *message, int appErrNo = 0); + Exception (char const *where, const String &message, int appErrNo = 0); + ~Exception () throw () {} char const *what() const throw(); int errNo() const; private: - char const *_message; + String _message; int appErrNo; }; Index: download.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/download.cc,v retrieving revision 2.35 diff -u -p -r2.35 download.cc --- download.cc 9 Nov 2002 13:44:52 -0000 2.35 +++ download.cc 16 Feb 2003 13:13:07 -0000 @@ -85,7 +85,7 @@ validateCachedPackage (String const &ful } delete thefile; if (count < 0) - throw new Exception ("__LINE__ __FILE__", (String ("IO Error reading ") + pkgsource.Cached()).cstr_oneuse(), APPERR_IO_ERROR); + throw new Exception ("__LINE__ __FILE__", String ("IO Error reading ") + pkgsource.Cached(), APPERR_IO_ERROR); md5_byte_t tempdigest[16]; md5_finish(&pns, tempdigest); @@ -125,7 +125,7 @@ check_for_cached (packagesource & pkgsou if (validateCachedPackage (prefix + pkgsource.Canonical (), pkgsource)) pkgsource.set_cached (prefix + pkgsource.Canonical ()); else - throw new Exception ("__LINE__ __FILE__", (String ("Package validation failure for ") + prefix + pkgsource.Canonical ()).cstr_oneuse(), APPERR_CORRUPT_PACKAGE); + throw new Exception ("__LINE__ __FILE__", String ("Package validation failure for ") + prefix + pkgsource.Canonical (), APPERR_CORRUPT_PACKAGE); return 1; } @@ -143,7 +143,7 @@ check_for_cached (packagesource & pkgsou if (validateCachedPackage (fullname, pkgsource)) pkgsource.set_cached (fullname ); else - throw new Exception ("__LINE__ __FILE__", (String ("Package validation failure for ") + fullname).cstr_oneuse(), APPERR_CORRUPT_PACKAGE); + throw new Exception ("__LINE__ __FILE__", String ("Package validation failure for ") + fullname, APPERR_CORRUPT_PACKAGE); return 1; } } Index: install.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/install.cc,v retrieving revision 2.54 diff -u -p -r2.54 install.cc --- install.cc 31 Jan 2003 22:37:14 -0000 2.54 +++ install.cc 16 Feb 2003 13:13:08 -0000 @@ -210,7 +210,7 @@ install_one_source (packagemeta & pkgm, md5_append (&pns, buffer, count); delete thefile; if (count < 0) - throw new Exception ("__LINE__ __FILE__", (String ("IO Error reading ") + source.Cached()).cstr_oneuse(), APPERR_IO_ERROR); + throw new Exception ("__LINE__ __FILE__", String ("IO Error reading ") + source.Cached(), APPERR_IO_ERROR); md5_byte_t tempdigest[16]; md5_finish(&pns, tempdigest); @@ -220,7 +220,7 @@ install_one_source (packagemeta & pkgm, log (LOG_BABBLE, String ("For file ") + source.Cached() + " ini digest is " + source.md5.print() + " file digest is " + tempMD5.print()); if (source.md5 != tempMD5) - throw new Exception ("__LINE__ __FILE__", (String ("Checksum failure for ") + source.Cached()).cstr_oneuse(), APPERR_CORRUPT_PACKAGE); + throw new Exception ("__LINE__ __FILE__", String ("Checksum failure for ") + source.Cached(), APPERR_CORRUPT_PACKAGE); } io_stream *tmp = io_stream::open (source.Cached (), "rb"); archive *thefile = 0;