From 1c364722a7df764f6f7d60bd3a93e03f18beb6e7 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Sat, 17 Nov 2018 04:46:25 -0800 Subject: [PATCH] mount completions: don't truncate mounts with spaces in them --- share/functions/__fish_print_mounted.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_print_mounted.fish b/share/functions/__fish_print_mounted.fish index 2a390fdb9..9df25875b 100644 --- a/share/functions/__fish_print_mounted.fish +++ b/share/functions/__fish_print_mounted.fish @@ -1,5 +1,5 @@ function __fish_print_mounted --description 'Print mounted devices' - if test -r /etc/mtab + if [ -r /etc/mtab ] # In mtab, spaces are replaced by a literal '\040' # So it's safe to get the second "field" and then replace it # \011 encodes a tab, \012 encodes a newline and \\ encodes a backslash @@ -7,6 +7,6 @@ function __fish_print_mounted --description 'Print mounted devices' # and tabs because of descriptions string replace -r '\S+ (\S+) .*' '$1'