Skip to content
Snippets Groups Projects
Commit 5837be93 authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Standards.URI: Survive base URI's without authority sections.

Fixes "Bad argument 1 to sizeof()." for eg

  Standards.URI("<foo@example.com>", "mailto:<bar@example.com>");
parent 2e3c3f03
No related branches found
No related tags found
No related merge requests found
...@@ -280,7 +280,7 @@ void reparse_uri(this_program|string|void base_uri) ...@@ -280,7 +280,7 @@ void reparse_uri(this_program|string|void base_uri)
// DWIM for "www.cnn.com" style input, when parsed in the context of // DWIM for "www.cnn.com" style input, when parsed in the context of
// base "http://". // base "http://".
if( !has_prefix(uri, "//") && !scheme && this::base_uri?->scheme && if( !has_prefix(uri, "//") && !scheme && this::base_uri?->scheme &&
!sizeof(this::base_uri->authority) && !sizeof(this::base_uri->authority || "") &&
!sizeof(this::base_uri->path)) !sizeof(this::base_uri->path))
{ {
DEBUG("DWIM authority: %O\n", uri); DEBUG("DWIM authority: %O\n", uri);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment