[58842] trunk/base/src/pextlib1.0/curl.c

toby at macports.org toby at macports.org
Mon Oct 5 22:55:48 PDT 2009


Revision: 58842
          http://trac.macports.org/changeset/58842
Author:   toby at macports.org
Date:     2009-10-05 22:55:47 -0700 (Mon, 05 Oct 2009)
Log Message:
-----------
remove compatibility code for ancient version of libcurl

Modified Paths:
--------------
    trunk/base/src/pextlib1.0/curl.c

Modified: trunk/base/src/pextlib1.0/curl.c
===================================================================
--- trunk/base/src/pextlib1.0/curl.c	2009-10-06 05:54:23 UTC (rev 58841)
+++ trunk/base/src/pextlib1.0/curl.c	2009-10-06 05:55:47 UTC (rev 58842)
@@ -86,30 +86,18 @@
  * @return TCL_OK if inErrorCode is 0, TCL_ERROR otherwise.
  */
 int
-SetResultFromCurlErrorCode(Tcl_Interp* interp, CURLcode inErrorCode)
+SetResultFromCurlErrorCode(Tcl_Interp *interp, CURLcode inErrorCode)
 {
-	int theResult;
+	int result = TCL_ERROR;
 
-	switch(inErrorCode)
-	{
-		case CURLE_OK:
-			Tcl_SetResult(interp, "", TCL_STATIC);
-			theResult = TCL_OK;
-			break;
-		
-		default: {
-#if LIBCURL_VERSION_NUM >= 0x070c00 /* 7.12.0 */
-			Tcl_SetResult(interp, (char *)curl_easy_strerror(inErrorCode), TCL_VOLATILE);
-#else
-			char theErrorString[512];
-			(void)snprintf(theErrorString, sizeof(theErrorString), "curl error %i", inErrorCode);
-			Tcl_SetResult(interp, theErrorString, TCL_VOLATILE);
-#endif
-			theResult = TCL_ERROR;
-		}
+	if (inErrorCode == CURLE_OK) {
+		Tcl_SetResult(interp, "", TCL_STATIC);
+		result = TCL_OK;
+	} else {
+		Tcl_SetResult(interp, (char *)curl_easy_strerror(inErrorCode), TCL_VOLATILE);
 	}
-	
-	return theResult;
+
+	return result;
 }
 
 /**
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091005/354c9971/attachment.html>


More information about the macports-changes mailing list