Changeset 30087 for trunk/base
- Timestamp:
- Oct 19, 2007, 12:14:15 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/pextlib1.0/curl.c
r29332 r30087 151 151 const char* effectiveURLVarName = NULL; 152 152 char* effectiveURL = NULL; 153 char* userAgent = "MacPorts libcurl/" LIBCURL_VERSION; 153 154 int optioncrsr; 154 155 int lastoption; … … 200 201 break; 201 202 } 203 } else if (strcmp(theOption, "--user-agent") == 0) { 204 /* check we also have the parameter */ 205 if (optioncrsr < lastoption) { 206 optioncrsr++; 207 userAgent = Tcl_GetString(objv[optioncrsr]); 208 } else { 209 Tcl_SetResult(interp, 210 "curl fetch: --user-agent option requires a parameter", 211 TCL_STATIC); 212 theResult = TCL_ERROR; 213 break; 214 } 202 215 } else { 203 216 char theErrorString[512]; … … 264 277 265 278 /* -A option */ 266 theCurlCode = curl_easy_setopt(theHandle, CURLOPT_USERAGENT, "MacPorts libcurl/" LIBCURL_VERSION);279 theCurlCode = curl_easy_setopt(theHandle, CURLOPT_USERAGENT, userAgent); 267 280 if (theCurlCode != CURLE_OK) { 268 281 theResult = SetResultFromCurlErrorCode(interp, theCurlCode);
Note: See TracChangeset
for help on using the changeset viewer.