comparison nnchat.c @ 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
comparison
equal deleted inserted replaced
113:2a53156e7e12 114:256cca8cc086
578 printMsg("Setting color to #%06x\n", optUserColor); 578 printMsg("Setting color to #%06x\n", optUserColor);
579 nn_send_msg(sock, optUserName2, "%%2FSetFontColor%%20%%2Dcolor%%20%06X", optUserColor); 579 nn_send_msg(sock, optUserName2, "%%2FSetFontColor%%20%%2Dcolor%%20%06X", optUserColor);
580 return 0; 580 return 0;
581 } else if (!strncasecmp(buf, "/w ", 3)) { 581 } else if (!strncasecmp(buf, "/w ", 3)) {
582 /* Open given username's profile via firefox in a new tab */ 582 /* Open given username's profile via firefox in a new tab */
583 char *name = buf + 3; 583 char *name = buf + 3, *browser = getenv("BROWSER");
584 pid_t pud; 584 while (*name && isspace(*name)) name++;
585
586 if (browser == NULL)
587 browser = "firefox";
588
585 tmpStr = nn_encode_str1(name); 589 tmpStr = nn_encode_str1(name);
586 snprintf(tmpBuf, sizeof(tmpBuf), "firefox -remote \"openurl(http://www.newbienudes.com/profile/%s/,new-tab)\"", tmpStr); 590 snprintf(tmpBuf, sizeof(tmpBuf), "%s -remote \"openurl(http://www.newbienudes.com/profile/%s/,new-tab)\"",
591 browser, tmpStr);
587 th_free(tmpStr); 592 th_free(tmpStr);
588 593
589 printMsg("Opening profile for: '%s'\n", name); 594 printMsg("Opening profile for: '%s'\n", name);
590 printMsg("%s\n", tmpBuf); 595 printMsg("%s\n", tmpBuf);
591 system(tmpBuf); 596 system(tmpBuf);