commit e2089110b6f63056d1a67d5eec3885d677b75b00 from: Omar Polo date: Wed Feb 21 12:26:09 2024 UTC iri: always output file:// urls with the `//' separator commit - c6432d394ee01ce54bac5def39e490a9de261cc3 commit + e2089110b6f63056d1a67d5eec3885d677b75b00 blob - 1889d871eb431f8caf500fd60d8775627234eb4c blob + 57ff66a3e77403ef075b3c22718eca185b870b5f --- iri.c +++ iri.c @@ -646,7 +646,9 @@ iri_unparse(const struct iri *i, char *buf, size_t buf int need_ss, have_path, need_s; int r; - need_ss = (i->iri_flags & IH_AUTHORITY); + /* file is a quirky scheme */ + need_ss = (i->iri_flags & IH_AUTHORITY) || + !strcmp(i->iri_scheme, "file"); have_path = i->iri_flags & IH_PATH; need_s = have_path && (i->iri_flags & IH_AUTHORITY) && i->iri_path[0] != '/'; blob - d3405c482ff4d3201d2ef94c99a4c3c5be44b0ce blob + bdf79a290d922436c0de9bf5d239654ae46cc4fc --- test/iritest.c +++ test/iritest.c @@ -170,5 +170,8 @@ main(void) ret |= setquery(base, "%20", "gemini://a/?%2520"); ret |= setquery(base, "%20%20%20", "gemini://a/?%2520%2520%2520"); + ret |= resolve(base, "file:///tmp/foo", "file:///tmp/foo"); + ret |= resolve(base, "file:/tmp/foo", "file:///tmp/foo"); + return (ret); }