On Mon, Sep 24, 2012 at 05:26:53AM -0400, Paolo Bonzini wrote: > > + qp = query_params_parse(unescape_str); > > query_params_parse already does the unescaping.
Hmm it failed to parse the options properly when I had an escape sequence, hence resorted to unescaping the query string manually. Look at the below gdb debug steps of your uri.c... 2302 test("gluster+unix:///b?c=d%26e=f"); (gdb) s test (x=0x4062c4 "gluster+unix:///b?c=d%26e=f") at uri.c:2279 2279 URI *uri = uri_parse(x); (gdb) n 2283 if (!uri) { (gdb) p *uri $1 = {scheme = 0x607070 "gluster+unix", opaque = 0x0, authority = 0x0, server = 0x0, user = 0x0, port = 0, path = 0x607090 "/b", fragment = 0x0, cleanup = 0, query = 0x6070b0 "c=d%26e=f"} (gdb) n 2289 qp = query_params_parse(uri->query); (gdb) p *qp $2 = {n = 1, alloc = 1, p = 0x6070f0} You can see that qp->n is still 1, but 2 was expected. Regards, Bharata.