From e2f4ccfcf8a2ae382203ede50b2b1d466a3062f7 Mon Sep 17 00:00:00 2001 From: polyphemus Date: Thu, 4 Apr 2013 13:37:39 +0200 Subject: [PATCH] Fix passing multiple arguments to programs from Exec key from .desktop files. Was missing quotes around variables, now checks which's return code. --- src/cdm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cdm b/src/cdm index c4505fe..3290fd5 100755 --- a/src/cdm +++ b/src/cdm @@ -108,11 +108,9 @@ if [[ "${#binlist[@]}" == 0 && -d /usr/share/xsessions ]]; then if [[ -n ${execkey} && -n ${namekey} ]]; then # The .desktop files allow there Exec keys to use $PATH lookup. binitem="$(which $(cut -f 1 -d ' ' <<< ${execkey}))" - binargs="$(cut -s -f 2- -d ' ' <<< ${execkey})" # If which fails to return valid path, skip to next .desktop file. - if [ -z $binitem ]; then continue; fi - if [ -n $binargs ]; then binitem+=" ${binargs}"; fi - binlist+=("${binitem}") + if [[ $? != 0 ]]; then continue; fi + binlist+=("${binitem} $(cut -s -f 2- -d ' ' <<< ${execkey})") flaglist+=('X') namelist+=("${namekey}") fi