Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zsh umount completion bug for most platforms, #533679

I reported this bug some time ago, and I was suprised to see it still exists in 4.0.5:

http://sourceforge.net/tracker/ index.php?func=detail&aid=533679&group_id=4068&atid=104068

It'd appear you guys aren't even using that bug tracker however, from how the FAQ words things. So, I'm posting it here.

It seems that the umount completion pretty much presumes every platform uses /etc/mtab, if they aren't FreeBSD. However, It's mostly the other way around, unfortunately. FreeBSD, OpenBSD, NetBSD, Solaris, HP-UX, MacOS X all do not have mtab files.

This patch against Completion/Unix/Command/_mount changes the assumption so that IRIX & Linux use mtab, and everyone else uses the output of the mount command. Please CC me any comments as I am not on this list.

--- _mount~     Fri Aug  9 09:30:13 2002
+++ _mount      Tue Aug 13 16:59:43 2002
@@ -748,17 +748,18 @@
     local dev_tmp mp_tmp mline

     case "$OSTYPE" in
-    freebsd*)
+    linux*|irix*)
+      tmp=( "${(@f)$(< /etc/mtab)}" )
+      dev_tmp=( "${(@)${(@)tmp%% *}:#none}" )
+      mp_tmp=( "${(@)${(@)tmp#* }%% *}" )
+      ;;
+    *)
       /sbin/mount | while read mline; do
         dev_tmp=( $dev_tmp $mline[(w)1] )
         mp_tmp=( $mp_tmp $mline[(w)3] )
-    *)
-      tmp=( "${(@f)$(< /etc/mtab)}" )
-      dev_tmp=( "${(@)${(@)tmp%% *}:#none}" )
-      mp_tmp=( "${(@)${(@)tmp#* }%% *}" )
-      ;;

     _alternative \

Thomas Stromberg <thomas@xxxxxxxxxxxxx>
Senior UNIX Administrator, Bell & Howell
cell/sms: 919-272-3094
"downtime is for amateurs".

Messages sorted by: Reverse Date, Date, Thread, Author