1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

fix completion error when path contain spaces

add comment to explain that there is no need to check previlege in windows
This commit is contained in:
xiaonaitong 2011-09-21 18:34:17 +08:00
parent d1a38d150e
commit e5e0001dad
2 changed files with 5 additions and 3 deletions

View File

@ -76,7 +76,7 @@ def unico(text):
def save(path_dict, dic_file): def save(path_dict, dic_file):
"""Save the database in an atomic way, and preserve """Save the database in an atomic way, and preserve
a backup file.""" a backup file."""
# If the dic_file exists, check that it belongs to us # If the dic_file exists and os is not windows, check that it belongs to us
# Otherwise, fail quietly # Otherwise, fail quietly
if (not os.path.exists(dic_file)) or os.name == 'nt' or os.getuid() == os.stat(dic_file)[4]: if (not os.path.exists(dic_file)) or os.name == 'nt' or os.getuid() == os.stat(dic_file)[4]:
temp = NamedTemporaryFile(dir=CONFIG_DIR, delete=False) temp = NamedTemporaryFile(dir=CONFIG_DIR, delete=False)

View File

@ -20,10 +20,12 @@ _autojump()
local cur local cur
cur=${COMP_WORDS[*]:1} cur=${COMP_WORDS[*]:1}
comps=$(autojump --bash --completion $cur) comps=$(autojump --bash --completion $cur)
for i in $comps while read i
do do
COMPREPLY=("${COMPREPLY[@]}" "${i}") COMPREPLY=("${COMPREPLY[@]}" "${i}")
done done <<EOF
$comps
EOF
} }
complete -F _autojump j complete -F _autojump j