about summary refs log tree commit diff
path: root/Completion/Unix/Type
diff options
context:
space:
mode:
authorNorbert Lange <nolange79@gmail.com>2022-05-24 22:26:29 +0200
committerMatthew Martin <phy1729@gmail.com>2022-05-25 22:50:48 -0500
commitc1f1bbc5b9c128944b82afed25140ee62ccf522a (patch)
treed297ce494674cd5aba7d7b65ffdb9472255a839c /Completion/Unix/Type
parent1e52cd968d7ffd9da3249ef01f6c41f8b29e4df3 (diff)
downloadzsh-c1f1bbc5b9c128944b82afed25140ee62ccf522a.tar.gz
zsh-c1f1bbc5b9c128944b82afed25140ee62ccf522a.tar.xz
zsh-c1f1bbc5b9c128944b82afed25140ee62ccf522a.zip
github #93: Replace /etc/mtab with /proc/self/mounts for Linux
/proc/self/mounts has been available since Linux 2.4.19,
released in 2002. /etc/mtab is usually a symlink to this
file but might not exist
Diffstat (limited to 'Completion/Unix/Type')
-rw-r--r--Completion/Unix/Type/_umountable7
1 files changed, 6 insertions, 1 deletions
diff --git a/Completion/Unix/Type/_umountable b/Completion/Unix/Type/_umountable
index 7ffce5bb4..6e4988e2d 100644
--- a/Completion/Unix/Type/_umountable
+++ b/Completion/Unix/Type/_umountable
@@ -3,7 +3,12 @@ local tmp
 local dev_tmp dpath_tmp mp_tmp mline
 
 case "$OSTYPE" in
-linux*|irix*)
+linux*)
+  tmp=( "${(@f)$(< /proc/self/mounts)}" )
+  dev_tmp=( "${(@)${(@)tmp%% *}:#none}" )
+  mp_tmp=( "${(@)${(@)tmp#* }%% *}" )
+  ;;
+irix*)
   tmp=( "${(@f)$(< /etc/mtab)}" )
   dev_tmp=( "${(@)${(@)tmp%% *}:#none}" )
   mp_tmp=( "${(@)${(@)tmp#* }%% *}" )