26 #define ENABLE_CURLX_PRINTF 68 while(fgets(buffer,
sizeof(buffer), file)) {
69 ptr = strchr(buffer,
'\r');
72 ptr = strchr(buffer,
'\n');
75 buflen = strlen(buffer);
76 ptr =
realloc(
string, stringlen + buflen + 1);
82 strcpy(
string + stringlen, buffer);
100 if(!buffer || (alloc == nused)) {
102 if(alloc + 1 > ((
size_t)-1)/2) {
108 newbuf =
realloc(buffer, alloc + 1);
115 nread =
fread(buffer + nused, 1, alloc-nused, file);
119 buffer[nused] =
'\0';
122 newbuf =
realloc(buffer, nused + 1);
141 #ifdef HAVE_WRITABLE_ARGV 146 size_t len = strlen(str);
147 memset(str,
' ', len);
169 num = strtol(str, &endptr, 10);
172 if((endptr != str) && (endptr == str + strlen(str))) {
218 num = strtod(str, &endptr);
225 if((endptr != str) && (endptr == str + strlen(str))) {
272 const char *sep =
",";
275 static struct sprotos {
314 for(token = strtok(buffer, sep);
316 token = strtok(NULL, sep)) {
317 enum e_action { allow, deny,
set }
action = allow;
319 struct sprotos const *pp;
339 for(pp = protos; pp->name; pp++) {
361 warnf(config->
global,
"unrecognized protocol '%s'\n", token);
378 const char *
const *pp;
382 for(pp = curlinfo->
protocols; *pp; pp++) {
404 #if(SIZEOF_CURL_OFF_T > SIZEOF_LONG) 414 *val = strtol(str, &endptr, 0);
415 if((*val == LONG_MIN || *val == LONG_MAX) && errno == ERANGE)
418 if((endptr != str) && (endptr == str + strlen(str)))
436 psep = strchr(*userpwd,
':');
439 osep = strchr(*userpwd,
';');
441 if(!psep && **userpwd !=
';') {
443 char passwd[256] =
"";
446 size_t userlen = strlen(*userpwd);
455 "Enter %s password for user '%s':",
459 "Enter %s password for user '%s' on URL #%" 464 getpass_r(prompt, passwd,
sizeof(passwd));
465 passwdlen = strlen(passwd);
478 passptr[userlen] =
':';
479 memcpy(&passptr[userlen + 1], passwd, passwdlen + 1);
506 warnf(config->
global,
"unrecognized ftp file method '%s', using default\n",
519 warnf(config->
global,
"unrecognized ftp CCC method '%s', using default\n",
534 warnf(config->
global,
"unrecognized delegation method '%s', using none\n",
590 static struct s_tls_max {
591 const char *tls_max_str;
593 }
const tls_max_array[] = {
603 for(i = 0; i <
sizeof(tls_max_array)/
sizeof(tls_max_array[0]); i++) {
604 if(!strcmp(str, tls_max_array[i].tls_max_str)) {
605 *val = tls_max_array[
i].tls_max;
#define CURLGSSAPI_DELEGATION_NONE
CURL_EXTERN curl_version_info_data * curl_version_info(CURLversion)
#define CURL_FORMAT_CURL_OFF_TU
UNITTEST_START char * ptr
#define realloc(ptr, size)
struct GlobalConfig * global
UNITTEST_START int result
memcpy(filename, filename1, strlen(filename1))
struct curl_httppost * last
#define CURLGSSAPI_DELEGATION_POLICY_FLAG
CURL_EXTERN struct curl_slist * curl_slist_append(struct curl_slist *, const char *)
CURLofft curlx_strtoofft(const char *str, char **endp, int base, curl_off_t *num)
CURL_TYPEOF_CURL_OFF_T curl_off_t
struct OperationConfig * next
CURL_EXTERN int curl_strequal(const char *s1, const char *s2)
#define CURLGSSAPI_DELEGATION_FLAG
#define Curl_safefree(ptr)
UNITTEST_START int * value
const char *const * protocols
#define calloc(nbelem, size)