From 3bcdd78bca37a770d388b6c4777b147331ac003a Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 8 Aug 2012 16:26:03 +0000 Subject: [PATCH] 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 --- legacy/efreet/src/lib/efreet_desktop_command.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/legacy/efreet/src/lib/efreet_desktop_command.c b/legacy/efreet/src/lib/efreet_desktop_command.c index 8a615b6ce4..bf97f8fdfa 100644 --- a/legacy/efreet/src/lib/efreet_desktop_command.c +++ b/legacy/efreet/src/lib/efreet_desktop_command.c @@ -351,12 +351,14 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command) int size = PATH_MAX; int file_added = 0; Efreet_Desktop_Command_File *file = eina_list_data_get(l); + int single; exec = malloc(size); if (!exec) goto error; p = command->desktop->exec; len = 0; + single = 0; while (*p) { if (len >= size - 1) @@ -385,6 +387,7 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command) &len, file, *p); if (!exec) goto error; file_added = 1; + single = 1; } break; case 'F': @@ -395,6 +398,7 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command) { exec = efreet_desktop_command_append_multiple(exec, &size, &len, command, *p); + fprintf(stderr, "EXE: '%s'\n", exec); if (!exec) goto error; file_added = 1; } @@ -465,8 +469,11 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command) #endif exec[len++] = '\0'; - execs = eina_list_append(execs, exec); - exec = NULL; + if ((single) || (!execs)) + { + execs = eina_list_append(execs, exec); + exec = NULL; + } /* 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. */