mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-03 16:30:29 +00:00
Made impl a little easier to read
This commit is contained in:
parent
088089aa11
commit
bbcca4ba87
1 changed files with 7 additions and 4 deletions
|
@ -2581,13 +2581,16 @@ static void TuneServerSocket(void) {
|
|||
|
||||
static void OpenBrowser(const char *serveraddrname) {
|
||||
char openbrowsercommand[255];
|
||||
if (IsWindows()){
|
||||
snprintf(openbrowsercommand, sizeof(openbrowsercommand), "explorer http://%s", serveraddrname);
|
||||
char *prog;
|
||||
if (IsWindows()) {
|
||||
prog = "explorer";
|
||||
} else if (IsXnu()) {
|
||||
snprintf(openbrowsercommand, sizeof(openbrowsercommand), "open http://%s", serveraddrname);
|
||||
prog = "open";
|
||||
} else {
|
||||
snprintf(openbrowsercommand, sizeof(openbrowsercommand), "xdg-open http://%s", serveraddrname);
|
||||
prog = "xdg-open";
|
||||
}
|
||||
snprintf(openbrowsercommand, sizeof(openbrowsercommand), "%s http://%s", prog,
|
||||
serveraddrname);
|
||||
DEBUGF("Opening browser with command %s\n", openbrowsercommand);
|
||||
system(openbrowsercommand);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue