zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] discard sed stderr in _mime_types
@ 2014-09-01  7:53 Mark Oteiza
  0 siblings, 0 replies; only message in thread
From: Mark Oteiza @ 2014-09-01  7:53 UTC (permalink / raw)
  To: zsh-workers


---
Hi,

~/.mime.types need not exist despite the fact that /etc/mime.types
generally does, so let's not have sed complaining about ENOENT and
ruining the completion

Mark

diff -aur a/Completion/Unix/Type/_mime_types b/Completion/Unix/Type/_mime_types
--- a/Completion/Unix/Type/_mime_types	2014-09-01 03:42:17.770140002 -0400
+++ b/Completion/Unix/Type/_mime_types	2014-09-01 03:42:50.990020179 -0400
@@ -33,10 +33,10 @@
   compset -p $(( ${#maintype} + 1 ))
   _wanted mime-subtypes expl 'MIME subtype' \
       compadd -- $(sed -ne "s%^\(type=\|\)${maintype}/\([^ 	]*\).*$%\2%p" \
-      $type_files)
+      $type_files 2>/dev/null)
 else
   # Search for main type.
   _wanted mime-types expl 'MIME type' \
     compadd -S/ -- $(sed -ne "s/^type=//" \
-      -e "s%^\(${PREFIX:-[a-z]}[^=\"]*\)/.*$%\1%p" $type_files)
+      -e "s%^\(${PREFIX:-[a-z]}[^=\"]*\)/.*$%\1%p" $type_files 2>/dev/null)
 fi


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-01  7:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-01  7:53 [PATCH] discard sed stderr in _mime_types Mark Oteiza

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).