Commit 3a1492ec authored by Ondrej Holy's avatar Ondrej Holy

gio: Fix completion of URIs without hostname part

Currently, "gio list file:///h<tab>" doesn't complete "file:///home"
because the result of "dirname file:///h" is not "file:///" but "file:/",
which breaks the consequent logic. Let's subtract basename from the
path in order to workaround this issue.
parent 90bdc2ff
......@@ -43,7 +43,8 @@ __gio_location() {
if [[ $cur =~ "/"$ ]]; then
dir="$cur"
elif [[ $cur =~ "/" ]]; then
dir="$(dirname "$cur")/"
# Subtract basename because dirname cmd doesn't work well with schemes
dir=${cur%$(basename "$cur")}
fi
# List daemon mounts, just if dir is not specified, or looks like scheme
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment