old_shift = uri->hostlen;
uri->hostlen -= shift;
- remain = (uri->urllen - (uri->host - uri->string)) - uri->hostlen;
+ remain = (uri->urllen - (uri->host - uri->string)) - old_shift;
g_assert (remain >= 0);
memmove (uri->host + uri->hostlen, uri->host + old_shift,
remain);
old_shift = uri->datalen;
uri->datalen -= shift;
- remain = (uri->urllen - (uri->data - uri->string)) - uri->datalen;
+ remain = (uri->urllen - (uri->data - uri->string)) - old_shift;
g_assert (remain >= 0);
memmove (uri->data + uri->datalen, uri->data + old_shift,
remain);
old_shift = uri->querylen;
uri->querylen -= shift;
- remain = (uri->urllen - (uri->query - uri->string)) - uri->querylen;
+ remain = (uri->urllen - (uri->query - uri->string)) - old_shift;
g_assert (remain >= 0);
memmove (uri->query + uri->querylen, uri->query + old_shift,
remain);
end
cases = {
+ {[[http://example.net/path/.]], true, {
+ host = 'example.net', path = 'path'
+ }},
{'http://example.net/hello%20world.php?arg=x#fragment', true, {
host = 'example.net', fragment = 'fragment', query = 'arg=x',
path = 'hello world.php',