Mercurial > hg > nnchat
changeset 114:256cca8cc086
Support $BROWSER environment variable setting.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 24 Oct 2010 21:48:16 +0300 |
parents | 2a53156e7e12 |
children | 300a6ea4aff3 |
files | nnchat.c |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/nnchat.c Sun Oct 24 21:38:47 2010 +0300 +++ b/nnchat.c Sun Oct 24 21:48:16 2010 +0300 @@ -580,10 +580,15 @@ return 0; } else if (!strncasecmp(buf, "/w ", 3)) { /* Open given username's profile via firefox in a new tab */ - char *name = buf + 3; - pid_t pud; + char *name = buf + 3, *browser = getenv("BROWSER"); + while (*name && isspace(*name)) name++; + + if (browser == NULL) + browser = "firefox"; + tmpStr = nn_encode_str1(name); - snprintf(tmpBuf, sizeof(tmpBuf), "firefox -remote \"openurl(http://www.newbienudes.com/profile/%s/,new-tab)\"", tmpStr); + snprintf(tmpBuf, sizeof(tmpBuf), "%s -remote \"openurl(http://www.newbienudes.com/profile/%s/,new-tab)\"", + browser, tmpStr); th_free(tmpStr); printMsg("Opening profile for: '%s'\n", name);