/* This line is NOT a HTTP header style line, we do offer support for
reading the odd netscape cookies-file format here */
char *firstptr;
+ char *tok_buf;
int fields;
if(lineptr[0]=='#') {
if(ptr)
*ptr=0; /* clear it */
- firstptr=strtok(lineptr, "\t"); /* first tokenize it on the TAB */
+ firstptr=strtok_r(lineptr, "\t", &tok_buf); /* first tokenize it on the TAB */
/* Here's a quick check to eliminate normal HTTP-headers from this */
if(!firstptr || strchr(firstptr, ':')) {
/* Now loop through the fields and init the struct we already have
allocated */
- for(ptr=firstptr, fields=0; ptr; ptr=strtok(NULL, "\t"), fields++) {
+ for(ptr=firstptr, fields=0; ptr; ptr=strtok_r(NULL, "\t", &tok_buf), fields++) {
switch(fields) {
case 0:
co->domain = strdup(ptr);
file = fopen(netrcbuffer, "r");
if(file) {
char *tok;
+ char *tok_buf;
while(fgets(netrcbuffer, sizeof(netrcbuffer), file)) {
- tok=strtok(netrcbuffer, " \t\n");
+ tok=strtok_r(netrcbuffer, " \t\n", &tok_buf);
while(tok) {
switch(state) {
case NOTHING:
}
break;
} /* switch (state) */
- tok = strtok(NULL, " \t\n");
+ tok = strtok_r(NULL, " \t\n", &tok_buf);
} /* while (tok) */
} /* while fgets() */
* checked if the lowercase versions don't exist.
*/
char *no_proxy=NULL;
+ char *no_proxy_tok_buf;
char *proxy=NULL;
char proxy_env[128];
/* NO_PROXY wasn't specified or it wasn't just an asterisk */
char *nope;
- nope=no_proxy?strtok(no_proxy, ", "):NULL;
+ nope=no_proxy?strtok_r(no_proxy, ", ", &no_proxy_tok_buf):NULL;
while(nope) {
if(strlen(nope) <= strlen(conn->name)) {
char *checkn=
break;
}
}
- nope=strtok(NULL, ", ");
+ nope=strtok_r(NULL, ", ", &no_proxy_tok_buf);
}
if(!nope) {
/* It was not listed as without proxy */