X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/136406deb8d6adab122ee83f17c7a36eee8d81d1..444be90901ad09e78d0ff2a92872f43a510f5425:/disobedience/help.c diff --git a/disobedience/help.c b/disobedience/help.c index 5ebe457..ca5a8d8 100644 --- a/disobedience/help.c +++ b/disobedience/help.c @@ -24,12 +24,23 @@ #include /** @brief Display the manual page */ -void popup_help(void) { +void popup_help(const char *what) { char *path; pid_t pid; int w; - byte_xasprintf(&path, "%s/index.html", dochtmldir); + if(!what) + what = "index.html"; +#if __APPLE__ + if(!strcmp(browser, "open")) + /* Apple's open(1) isn't really a web browser so needs some extra hints + * that it should see the argument as a URL. Otherwise it doesn't treat # + * specially. A better answer would be to identify the system web browser + * and invoke it directly. */ + byte_xasprintf(&path, "file:///%s/%s", dochtmldir, what); + else +#endif + byte_xasprintf(&path, "%s/%s", dochtmldir, what); if(!(pid = xfork())) { exitfn = _exit; if(!xfork()) {