mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-04 17:06:25 +00:00
dialog/unix: remove /usr/bin/env indirection
SDL process is using `posix_spawnp` which already does the path lookup so additional indirection via `env` is unnecessary
This commit is contained in:

committed by
Sam Lantinga

parent
c5acbef3bf
commit
ff82238172
@@ -82,7 +82,7 @@ char *zenity_clean_name(const char *name)
|
|||||||
|
|
||||||
/* Exec call format:
|
/* Exec call format:
|
||||||
*
|
*
|
||||||
* /usr/bin/env zenity --file-selection --separator=\n [--multiple]
|
* zenity --file-selection --separator=\n [--multiple]
|
||||||
* [--directory] [--save --confirm-overwrite]
|
* [--directory] [--save --confirm-overwrite]
|
||||||
* [--filename FILENAME] [--modal --attach 0x11w1nd0w]
|
* [--filename FILENAME] [--modal --attach 0x11w1nd0w]
|
||||||
* [--title TITLE] [--ok-label ACCEPT]
|
* [--title TITLE] [--ok-label ACCEPT]
|
||||||
@@ -91,7 +91,7 @@ char *zenity_clean_name(const char *name)
|
|||||||
*/
|
*/
|
||||||
static char** generate_args(const zenityArgs* info)
|
static char** generate_args(const zenityArgs* info)
|
||||||
{
|
{
|
||||||
int argc = 4;
|
int argc = 3;
|
||||||
int nextarg = 0;
|
int nextarg = 0;
|
||||||
char **argv = NULL;
|
char **argv = NULL;
|
||||||
|
|
||||||
@@ -143,8 +143,6 @@ static char** generate_args(const zenityArgs* info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ARGV PASS
|
// ARGV PASS
|
||||||
argv[nextarg++] = SDL_strdup("/usr/bin/env");
|
|
||||||
CHECK_OOM()
|
|
||||||
argv[nextarg++] = SDL_strdup("zenity");
|
argv[nextarg++] = SDL_strdup("zenity");
|
||||||
CHECK_OOM()
|
CHECK_OOM()
|
||||||
argv[nextarg++] = SDL_strdup("--file-selection");
|
argv[nextarg++] = SDL_strdup("--file-selection");
|
||||||
@@ -401,7 +399,7 @@ void SDL_Zenity_ShowFileDialogWithProperties(SDL_FileDialogType type, SDL_Dialog
|
|||||||
bool SDL_Zenity_detect(void)
|
bool SDL_Zenity_detect(void)
|
||||||
{
|
{
|
||||||
const char *args[] = {
|
const char *args[] = {
|
||||||
"/usr/bin/env", "zenity", "--version", NULL
|
"zenity", "--version", NULL
|
||||||
};
|
};
|
||||||
int status = -1;
|
int status = -1;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user