~robertgzr/porta

1a52e5184419cd2d7809b57ca6000cf6b61620b1 — Robert Günzler a month ago ca3f113 master
don't assume protocols always mandate `//` path prefix

http and file both follow that but mailto doesn't

Signed-off-by: Robert Günzler <r@gnzler.io>
1 files changed, 1 insertions(+), 1 deletions(-)

M src/openuri.rs
M src/openuri.rs => src/openuri.rs +1 -1
@@ 46,7 46,7 @@ pub fn call(conn: &Connection, args: Vec<String>) -> Result<OwnedObjectPath> {
    let options = HashMap::from([("ask", &Value::Bool(true))]);

    let a = args.get(0).unwrap(); // required
    let m = a.match_indices("://").next();
    let m = a.match_indices(":").next();

    // NOTE: support passing local file uris without schema
    if m.is_none() || a.get(..(m.unwrap().0)) == Some("file") {