str = text+pos;
text = text+pos;
unsigned int urlm_get_url(char **bufp, const char *text, unsigned int *position) {    char *buf;    const char *str;    unsigned int text_len, url_type, i, ii, next = 0, match = 0, pos;        if(blankstr(text))        return 0;        if(position == NULL) {        pos = 0;    }    else {        pos = *position;        str = text+pos;    }    text_len = strlen(text)-pos;        buf = (char*)callocm(text_len+1, sizeof(char));    if(buf == NULL)        return 0;            for(url_type = 0;url_type < 3;url_type++) {        for(i = 0, ii = 0;i < text_len;i++) {            if(match) {                if(str[i] == ' ') {                    *bufp = buf;                    *position = pos+i;                    return ii;                }                buf[ii++] = str[i];            }            else if(url_strings[url_type][next] == '*') {                if(str[i] == ' ') {                    freem(buf);                    return 0;                }                match = 1;                buf[ii++] = str[i];            }            else if(tolower(str[i]) == url_strings[url_type][next]) {                next++;                buf[ii++] = str[i];            }        }        if(match) {            *bufp = buf;            *position = pos+i;            return ii;        }        clearstr(buf, text_len+1);    }        freem(buf);    return 0;}