commit - 37d429b0d8162e4cd807cac4a5da76b15c92223c
commit + ba714ce39272d4bc52ac0f792f0f086afe3a477e
blob - b5e2ea68b3914b97562ab76862fe8177a1732aad
blob + bc56c53b31e09dddbca9ab0e5ccaabe4ba280fde
--- url.c
+++ url.c
return 1;
}
-/* ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) "://" */
+/*
+ * ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) "://"
+ * or
+ * "//"
+ */
static int
parse_scheme(struct parser *p)
{
p->parsed->scheme = p->iri;
+
+ if (p->iri[0] == '/' && p->iri[1] == '/') {
+ *p->iri = '\0';
+ p->iri += 2;
+ return 1;
+ }
if (!isalpha(*p->iri)) {
p->err = "illegal character in scheme";
return 0;
}
- if (u.scheme != NULL)
- strlcpy(url->scheme, u.scheme, sizeof(url->scheme));
+ /* XXX: hack around our not complete compliance with RFC 3986 */
+ /* if (u.scheme != NULL) */
+ strlcpy(url->scheme, "gemini", sizeof(url->scheme));
+
if (u.host != NULL)
strlcpy(url->host, u.host, sizeof(url->host));
if (u.port != NULL)
{
char *marker, *query, *hash, *i;
- marker = strstr(str, "://");
+ marker = strstr(str, "//");
query = strchr(str, '?');
hash = strchr(str, '#');