Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix spaces in bind-hooks paths #500

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tomb
Original file line number Diff line number Diff line change
Expand Up @@ -2594,8 +2594,11 @@ exec_safe_bind_hooks() {
# each line, using zsh word separator array subscript
_bindhooks="${mapfile[${mnt}/bind-hooks]}"
for h in ${(f)_bindhooks}; do
h=${h//\\ /__ESC_SPACE__}
s="${h[(w)1]}"
d="${h[(w)2]}"
s=${s//__ESC_SPACE__/ }
d=${d//__ESC_SPACE__/ }
[[ -z $s ]] && { _warning "bind-hooks file is broken"; return 1 }
[[ -z $d ]] && { _warning "bind-hooks file is broken"; return 1 }
maps+=($s $d)
Expand Down Expand Up @@ -3138,7 +3141,7 @@ umount_tomb() {
bind_mapper="${b[(ws:;:)1]}"
bind_mount="${b[(ws:;:)2]}"
_message "Closing tomb bind hook: ::1 hook::" "$bind_mount"
_sudo umount "$bind_mount" ||
_sudo umount "$(echo "$bind_mount")" ||
_failure "Tomb bind hook ::1 hook:: is busy, cannot close tomb." "$bind_mount"
done

Expand Down