From a9e1d573f301e39df4fbe77d2ee8896eeb90c692 Mon Sep 17 00:00:00 2001 From: Derek Schrock Date: Sun, 20 Oct 2013 20:01:42 -0400 Subject: [PATCH 1/2] Add QUITONLAUNCH option to urlview configure file --- sample.urlview | 3 +++ urlview.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/sample.urlview b/sample.urlview index add6279..9aa6817 100644 --- a/sample.urlview +++ b/sample.urlview @@ -27,3 +27,6 @@ REGEXP (((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t> #COMMAND netscape -remote 'openURL(%s)' COMMAND url_handler.sh + +# Quit urlview after launch +#QUITONLAUNCH diff --git a/urlview.c b/urlview.c index 4b7d159..4a36235 100644 --- a/urlview.c +++ b/urlview.c @@ -174,6 +174,7 @@ int main (int argc, char **argv) int oldcurrent = 0; int current = 0; int done = 0; + int quitonlaunch = 0; int redraw = FULL; int urlcount = 0; int urlcheck = 0; @@ -279,6 +280,10 @@ int main (int argc, char **argv) { expert = 1; } + else if (strcmp ("QUITONLAUNCH\n", buf) == 0) + { + quitonlaunch = 1; + } else { printf ("Unknown command: %s", buf); @@ -625,6 +630,7 @@ into a line of its own in your \n\ ((part = strtok(NULL, ":")) != NULL); free(tmpbuf); } + done = quitonlaunch; move (LINES - 1, 0); clrtoeol (); break; From 45443109fb1ecfc1a55725c210dd33ce6171dd14 Mon Sep 17 00:00:00 2001 From: Derek Schrock Date: Mon, 21 Oct 2013 16:46:25 -0400 Subject: [PATCH 2/2] add documentation to man and sgml file for QUITONLAUNCH --- urlview.man | 3 +++ urlview.sgml | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/urlview.man b/urlview.man index 39ea9ce..3722238 100644 --- a/urlview.man +++ b/urlview.man @@ -79,6 +79,9 @@ explicitly excludes single quotes.) WRAP \fIchoice\fP Enable or disable URL wrapping. Valid values for \fIchoice\fP are: yes, no (case insensitive). If this option is not supplied, the default behaviour is to disable wrapping. +.TP +QUITONLAUNCH +Will cause urlview to quit after you launch a URL. .SH FILES .PP .IP "/etc/urlview/system.urlview" diff --git a/urlview.sgml b/urlview.sgml index 6eace3e..2005b4f 100644 --- a/urlview.sgml +++ b/urlview.sgml @@ -58,6 +58,11 @@ messages: If you pass this URL to your shell, it could have nasty consequences. +

+QUITONLAUNCH +

+Will cause urlview to quit after you launch a URL. + FILES