httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Barr <gb...@pobox.com>
Subject my_urlword
Date Wed, 19 Jun 2002 22:21:22 GMT
I am having a problem with the current implementation of my_urlword.
The issue is that is splits first on &, then on ;. In our case we have
a URL which has both in (for reasons I don't really want to dig into),
which is causeing it to be parsed incorrectly.

So, is there a reson which the code works in this manner, and does not
look for both at the same time ?

If there is no particular reason, can I suggest an alternative implementation

static char *my_urlword(pool *p, const char **line)
{
    char *pos = *line;
    char ch;

    while ((ch = *pos) != NULL && ch != ';' && ch != '&')) {
	++pos;
    }

    res = ap_pstrndup(p, *line, pos - *line);

    while (ch == ';' || ch == '&') {
	++pos;
	ch = *pos;
    }

    *line = pos;

    return res;
}

Graham.


Mime
View raw message