[PATCH] Setup: Fix erroneous quoting of __LINE__ and __FILE__

Igor Pechtchanski pechtcha@cs.nyu.edu
Fri Jul 11 15:20:00 GMT 2003


The attached patch fixes erroneous quoting of the __LINE__ and __FILE__
macros in exception descriptions.
	Igor
==============================================================================
2003-07-11  Igor Pechtchanski  <pechtcha@cs.nyu.edu>

	* UserSettings.cc (UserSettings::deRegisterSetting): Fix
	erroneous __LINE__/__FILE__ usage.
	* download.cc (validateCachedPackage, check_for_cached): Ditto.
	* geturl.cc (getUrlToStream): Ditto.
	* install.cc (md5_one): Ditto.

-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton
-------------- next part --------------
Index: UserSettings.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/UserSettings.cc,v
retrieving revision 2.3
diff -u -p -r2.3 UserSettings.cc
--- UserSettings.cc	16 Mar 2003 02:06:05 -0000	2.3
+++ UserSettings.cc	11 Jul 2003 15:00:12 -0000
@@ -63,6 +63,6 @@ UserSettings::deRegisterSetting(UserSett
 {
   Settings::iterator i = find(settings.begin(), settings.end(), &aSetting);
   if (i == settings.end())
-    throw new Exception ("__LINE__ __FILE__", String ("Attempt to deregister non registered setting!"), APPERR_LOGIC_ERROR);
+    throw new Exception (__LINE__ __FILE__, String ("Attempt to deregister non registered setting!"), APPERR_LOGIC_ERROR);
   settings.erase(i);
 }
Index: download.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/download.cc,v
retrieving revision 2.37
diff -u -p -r2.37 download.cc
--- download.cc	7 Apr 2003 12:46:55 -0000	2.37
+++ download.cc	11 Jul 2003 15:00:12 -0000
@@ -88,7 +88,7 @@ validateCachedPackage (String const &ful
 	}
       delete thefile;
       if (count < 0)
-	throw new Exception ("__LINE__ __FILE__", String ("IO Error reading ") + pkgsource.Cached(), 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);
@@ -128,7 +128,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 (), APPERR_CORRUPT_PACKAGE);
+	  throw new Exception (__LINE__ __FILE__, String ("Package validation failure for ") + prefix + pkgsource.Canonical (), APPERR_CORRUPT_PACKAGE);
 	return 1;
       }
 
@@ -146,7 +146,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, APPERR_CORRUPT_PACKAGE);
+	    throw new Exception (__LINE__ __FILE__, String ("Package validation failure for ") + fullname, APPERR_CORRUPT_PACKAGE);
 	  return 1;
 	}
     }
Index: geturl.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/geturl.cc,v
retrieving revision 2.21
diff -u -p -r2.21 geturl.cc
--- geturl.cc	12 May 2002 11:16:24 -0000	2.21
+++ geturl.cc	11 Jul 2003 15:00:12 -0000
@@ -125,7 +125,7 @@ getUrlToStream (String const &_url, HWND
     {
       delete n;
       log (LOG_BABBLE) <<  "getUrlToStream failed!" << endLog;
-      throw new Exception ("__LINE__ __FILE__", "Error opening url",  APPERR_IO_ERROR);
+      throw new Exception (__LINE__ __FILE__, "Error opening url",  APPERR_IO_ERROR);
     }
 
   if (n->file_size)
Index: install.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/install.cc,v
retrieving revision 2.61
diff -u -p -r2.61 install.cc
--- install.cc	25 Mar 2003 20:57:13 -0000	2.61
+++ install.cc	11 Jul 2003 15:00:12 -0000
@@ -658,7 +658,7 @@ void md5_one (const packagesource& sourc
       // check the MD5 sum of the cached file here
       io_stream *thefile = io_stream::open (source.Cached (), "rb");
       if (!thefile)
-	throw new Exception ("__LINE__ __FILE__", String ("IO Error opening ") + source.Cached(), APPERR_IO_ERROR);
+	throw new Exception (__LINE__ __FILE__, String ("IO Error opening ") + source.Cached(), APPERR_IO_ERROR);
       md5_state_t pns;
       md5_init (&pns);
       
@@ -668,7 +668,7 @@ void md5_one (const packagesource& sourc
 	  md5_append (&pns, buffer, count);
       delete thefile;
       if (count < 0)
-	throw new Exception ("__LINE__ __FILE__", String ("IO Error reading ") + source.Cached(), 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);
@@ -678,6 +678,6 @@ void md5_one (const packagesource& sourc
       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(), APPERR_CORRUPT_PACKAGE);
+	  throw new Exception (__LINE__ __FILE__, String ("Checksum failure for ") + source.Cached(), APPERR_CORRUPT_PACKAGE);
     }
 }


More information about the Cygwin-apps mailing list