-// lousy linux doesn't have a clean way to do this, but you can point people
-// to docs on the BROWSER variable:
-// http://www.catb.org/~esr/BROWSER/
-#elif PLATFORM_LINUX
- if (strchr(url, '\'') != NULL) // Prevent simple shell injection.
- return;
-
- const char *envr = getenv("BROWSER");
- if (envr == NULL) // not specified? We'll try a pseudo-sane list...
- envr = "opera:mozilla:konqueror:firefox:netscape:xterm -e links:xterm -e lynx:";
-
- char *ptr = (char *) alloca(strlen(envr) + 1);
- if (ptr == NULL)
- return;
- strcpy(ptr, envr);
- envr = ptr;
-
- while ((ptr = strchr(envr, ':')) != NULL)
- {
- *ptr = '\0';
- if (try_launch_browser(envr, url))
- return;
- envr = ptr + 1;
- }
+#elif (defined(__APPLE__) && defined(__MACH__))
+ const char *fmt = "open '%s'";
+ const size_t len = strlen(fmt) + strlen(url) + 16;
+ char *buf = new char[len];
+ snprintf(buf, len, fmt, url);
+ system(buf);
+ delete[] buf;