Allow arguments to be passed to applications

This commit is contained in:
Jente Hidskes 2018-11-23 17:04:16 +01:00
parent fda8e22d13
commit d819eedc62
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA

5
cage.c
View file

@ -613,8 +613,7 @@ sig_handler(int signal)
int
main(int argc, char *argv[])
{
// TODO: add support for arguments to APPLICATION.
if (argc != 2) {
if (argc < 2) {
printf("Usage: %s APPLICATION\n", argv[0]);
return 1;
}
@ -706,7 +705,7 @@ main(int argc, char *argv[])
setenv("WAYLAND_DISPLAY", socket, true);
if (fork() == 0) {
execl("/bin/sh", "/bin/sh", "-c", argv[1], (void *)NULL);
execvp(argv[1], (char * const *) argv + 1);
}
wl_display_run(server.wl_display);