mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
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.
This commit is contained in:
parent
90bdc2ffb6
commit
3a1492ec4f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user