# HG changeset patch # User Matti Hamalainen # Date 1287946096 -10800 # Node ID 256cca8cc0865aea8f2a4f95dfa9cc25e6c2c74e # Parent 2a53156e7e12b9bc9dc6379bc9c54a3317097835 Support $BROWSER environment variable setting. diff -r 2a53156e7e12 -r 256cca8cc086 nnchat.c --- 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);