diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/documentwidget.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index 93604225..4332ae8f 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -4309,9 +4309,17 @@ static iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd) | |||
4309 | if (parts.path.end[-1] == '/') break; | 4309 | if (parts.path.end[-1] == '/') break; |
4310 | parts.path.end--; | 4310 | parts.path.end--; |
4311 | } | 4311 | } |
4312 | postCommandf_Root(w->root, | 4312 | iString *parentUrl = collectNewRange_String((iRangecc){ constBegin_String(d->mod.url), |
4313 | "open url:%s", | 4313 | parts.path.end }); |
4314 | cstr_Rangecc((iRangecc){ constBegin_String(d->mod.url), parts.path.end })); | 4314 | if (equalCase_Rangecc(parts.scheme, "gopher")) { |
4315 | /* Always go to a gophermap. */ | ||
4316 | iZap(parts); | ||
4317 | init_Url(&parts, parentUrl); | ||
4318 | if (parts.path.start && size_Range(&parts.path) >= 2) { | ||
4319 | ((char *) parts.path.start)[1] = '1'; | ||
4320 | } | ||
4321 | } | ||
4322 | postCommandf_Root(w->root, "open url:%s", cstr_String(parentUrl)); | ||
4315 | } | 4323 | } |
4316 | return iTrue; | 4324 | return iTrue; |
4317 | } | 4325 | } |