Commit Briefs
iri: rewrite remove_dot_segments to be clearer
the previous version was straight out RFC3986 (more or less, it had a bug I didn't spot), but it's ugly and extremely long. Rewrite it to be somewhat inspired by canonpath (from kern_pledge.c) and way simpler. There are some small differences in how UNIX paths and URLs paths are canonized (in UNIX path you don't care too much of a trailing '/', in URLs you do.) The new code is more clear and passes all the tests in RFC3986, so I'm calling it a win.
iri: fix remove_dot_segments algorithm
i've misread the description in the RFC; we should copy up to, but not including, the next '/' at the end and manually inject some '/' in some other cases.
iri: fix path check
path should *start* with "/" to enter that branch, not be exactly "/".
iri: fix logic in iri_unparse
make sure path starts with "/" only when there's an authority part, not when it's not there!
iri: avoid unpleasant infinite loop in remove_dot_segments
need to copy until the *next* path segment, otherwise we loop indefinitely if *p == '/'.
draft of the new iri parser
for the moment is just a URI (RFC3986) parser, and not even a complete one, but I like it much more than phos_uri. It's more gentle in the memory consumption and has a cleaner API. It's not complete, some parts are still stubbed or completely to implement, but it's the start. It compiles. Step-by-step integration of it in telescope and testing will come later.