From 5ef2a7e302a7460d86208083b93a392fd7106176 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Tue, 24 Jul 2012 17:02:43 -0400 Subject: Fix marco's last commit so the donothing binary doesn't show warnings with show_oops, and document how donothing behaves in the manpage and example conf. --- xombrero.1 | 4 ++++ xombrero.c | 6 +++++- xombrero.conf | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/xombrero.1 b/xombrero.1 index d208972..3a532a0 100644 --- a/xombrero.1 +++ b/xombrero.1 @@ -1344,6 +1344,10 @@ When is use the file will be downloaded to the .Pa download_dir before the MIME handler is called. +.Pp +The special binary name "donothing" may be used to ignore a MIME type +without displaying any warnings from being unable to execute the +binary. .It Cm oops_font Set the font used to display error messages. E.g. diff --git a/xombrero.c b/xombrero.c index e8ca32a..71ba37b 100644 --- a/xombrero.c +++ b/xombrero.c @@ -5060,9 +5060,13 @@ run_mimehandler(struct tab *t, char *mime_type, WebKitNetworkRequest *request) sv[0] = m->mt_action; sv[1] = (char *)webkit_network_request_get_uri(request); sv[2] = NULL; + + /* ignore donothing from example config */ + if (m->mt_action && !strcmp(m->mt_action, "donothing")) + return (0); + if (!g_spawn_async(NULL, sv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &gerr)) - /* No show_oops here to handle "donothing" example in config */ show_oops(t, "%s: could not spawn process (%s)", __func__, gerr ? gerr->message : "N/A"); return (0); diff --git a/xombrero.conf b/xombrero.conf index e454607..62f77c8 100644 --- a/xombrero.conf +++ b/xombrero.conf @@ -168,7 +168,7 @@ # Word documents. # mime_type = application/msword,soffice -# Ignoring flash can be done by using a non-existent binary name. +# Ignoring flash can be done by using the donothing pseudo-binary. # mime_type = application/x-shockwave-flash,donothing -- cgit 1.4.1-2-gfad0