From 45200f5418fa1e01eb3af510eefa4f6b1cb324e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Fri, 6 May 2022 08:14:45 +0300 Subject: [PATCH 1/1] Spartan: Default port; allow command line use --- src/app.c | 2 +- src/gmutil.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app.c b/src/app.c index 3ddc81b8..275d998d 100644 --- a/src/app.c +++ b/src/app.c @@ -920,7 +920,7 @@ static void communicateWithRunningInstance_App_(iApp *d, iProcessId instance, static iBool hasCommandLineOpenableScheme_(const iRangecc uri) { static const char *schemes[] = { - "gemini:", "gopher:", "finger:", "file:", "data:", "about:" + "gemini:", "gopher:", "finger:", "spartan:", "file:", "data:", "about:" }; iForIndices(i, schemes) { if (startsWithCase_Rangecc(uri, schemes[i])) { diff --git a/src/gmutil.c b/src/gmutil.c index 279cb091..51036634 100644 --- a/src/gmutil.c +++ b/src/gmutil.c @@ -107,6 +107,9 @@ uint16_t port_Url(const iUrl *d) { else if (equalCase_Rangecc(d->scheme, "http")) { port = 80; } + else if (equalCase_Rangecc(d->scheme, "spartan")) { + port = 300; + } else if (equalCase_Rangecc(d->scheme, "https")) { port = 443; } @@ -391,7 +394,8 @@ iBool isKnownScheme_Rangecc(iRangecc scheme) { } iBool isKnownUrlScheme_Rangecc(iRangecc scheme) { - static const char *schemes[] = { "gemini", "gopher", "finger", "http", "https", "file" }; + static const char *schemes[] = { "gemini", "gopher", "finger", "spartan", + "http", "https", "file" }; iForIndices(i, schemes) { if (equalCase_Rangecc(scheme, schemes[i])) { return iTrue; -- 2.34.1