forked from enlightenment/efl
fix efreet desktop exec to not duplicate the command n times in the
list when adding n params to a single cmd. SVN revision: 75019
This commit is contained in:
parent
cfe7431256
commit
3bcdd78bca
|
@ -351,12 +351,14 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
|
||||||
int size = PATH_MAX;
|
int size = PATH_MAX;
|
||||||
int file_added = 0;
|
int file_added = 0;
|
||||||
Efreet_Desktop_Command_File *file = eina_list_data_get(l);
|
Efreet_Desktop_Command_File *file = eina_list_data_get(l);
|
||||||
|
int single;
|
||||||
|
|
||||||
exec = malloc(size);
|
exec = malloc(size);
|
||||||
if (!exec) goto error;
|
if (!exec) goto error;
|
||||||
p = command->desktop->exec;
|
p = command->desktop->exec;
|
||||||
len = 0;
|
len = 0;
|
||||||
|
|
||||||
|
single = 0;
|
||||||
while (*p)
|
while (*p)
|
||||||
{
|
{
|
||||||
if (len >= size - 1)
|
if (len >= size - 1)
|
||||||
|
@ -385,6 +387,7 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
|
||||||
&len, file, *p);
|
&len, file, *p);
|
||||||
if (!exec) goto error;
|
if (!exec) goto error;
|
||||||
file_added = 1;
|
file_added = 1;
|
||||||
|
single = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'F':
|
case 'F':
|
||||||
|
@ -395,6 +398,7 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
|
||||||
{
|
{
|
||||||
exec = efreet_desktop_command_append_multiple(exec, &size,
|
exec = efreet_desktop_command_append_multiple(exec, &size,
|
||||||
&len, command, *p);
|
&len, command, *p);
|
||||||
|
fprintf(stderr, "EXE: '%s'\n", exec);
|
||||||
if (!exec) goto error;
|
if (!exec) goto error;
|
||||||
file_added = 1;
|
file_added = 1;
|
||||||
}
|
}
|
||||||
|
@ -465,8 +469,11 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
|
||||||
#endif
|
#endif
|
||||||
exec[len++] = '\0';
|
exec[len++] = '\0';
|
||||||
|
|
||||||
|
if ((single) || (!execs))
|
||||||
|
{
|
||||||
execs = eina_list_append(execs, exec);
|
execs = eina_list_append(execs, exec);
|
||||||
exec = NULL;
|
exec = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* If no file was added, then the Exec field doesn't contain any file
|
/* If no file was added, then the Exec field doesn't contain any file
|
||||||
* fields (fFuUdDnN). We only want to run the app once in this case. */
|
* fields (fFuUdDnN). We only want to run the app once in this case. */
|
||||||
|
|
Loading…
Reference in New Issue