mirror of
https://github.com/mintycube/st.git
synced 2024-10-22 14:05:49 +02:00
openurlonclick: using posix_spawnp instead of system ref. comments in #76
This commit is contained in:
parent
2eca262969
commit
bdeb1e7c4c
@ -133,8 +133,9 @@ openUrlOnClick(int col, int row, char* url_opener)
|
||||
{
|
||||
char *url = detecturl(col, row, 1);
|
||||
if (url) {
|
||||
char command[strlen(url_opener) + strlen(url) + 5];
|
||||
sprintf(command, "%s \"%s\"&", url_opener, url);
|
||||
system(command);
|
||||
extern char **environ;
|
||||
pid_t junk;
|
||||
char *argv[] = { url_opener, url, NULL };
|
||||
posix_spawnp(&junk, argv[0], NULL, NULL, argv, environ);
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include <spawn.h>
|
||||
|
||||
static inline void restoremousecursor(void) {
|
||||
if (!(win.mode & MODE_MOUSE) && xw.pointerisvisible)
|
||||
XDefineCursor(xw.dpy, xw.win, xw.vpointer);
|
||||
|
Loading…
Reference in New Issue
Block a user