about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@devio.us>2012-07-24 17:02:43 -0400
committerJosh Rickmar <jrick@devio.us>2012-07-24 17:02:43 -0400
commit5ef2a7e302a7460d86208083b93a392fd7106176 (patch)
treee074b9529ce796dfd612b1a6075c9b59fb06e379
parent9d6ac474a2454548a5eddaa2eac8b564eec09c72 (diff)
downloadxombrero-5ef2a7e302a7460d86208083b93a392fd7106176.tar.gz
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.
-rw-r--r--xombrero.14
-rw-r--r--xombrero.c6
-rw-r--r--xombrero.conf2
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