Make sure to spawn the corresponding browser(1) binary

This commit is contained in:
Pierre Pronchery 2014-09-27 12:35:47 +03:00
parent 365b2da9fe
commit db3d58dd64

View File

@ -35,6 +35,9 @@
#ifndef PREFIX #ifndef PREFIX
# define PREFIX "/usr/local" # define PREFIX "/usr/local"
#endif #endif
#ifndef BINDIR
# define BINDIR PREFIX "/bin"
#endif
#ifndef DATADIR #ifndef DATADIR
# define DATADIR PREFIX "/share" # define DATADIR PREFIX "/share"
#endif #endif
@ -57,6 +60,7 @@ static int _usage(void);
static int _gallery(void) static int _gallery(void)
{ {
char const * homedir; char const * homedir;
char const browser[] = BINDIR "/browser";
char const dcim[] = "DCIM"; char const dcim[] = "DCIM";
char * path; char * path;
#if GTK_CHECK_VERSION(2, 6, 0) #if GTK_CHECK_VERSION(2, 6, 0)
@ -74,8 +78,8 @@ static int _gallery(void)
/* this error should be caught by the final program */ /* this error should be caught by the final program */
mkdir(path, 0777); mkdir(path, 0777);
argv[arg] = path; argv[arg] = path;
execvp(argv[0], argv); execv(browser, argv);
_error(argv[0], 1); _error(browser, 1);
g_free(path); g_free(path);
return -1; return -1;
} }