Fixes bug #4492 (mis-using the return value of grep -q in openbox-gnome-session script
[mikachu/openbox.git] / data / xsession / openbox-gnome-session.in
index de46bec..1f17edb 100644 (file)
@@ -37,7 +37,7 @@ else
   if test -z "$SESSION"; then
       # if its empty then just run openbox
       SESSION="[openbox]"
-  elif test -z $(echo "$SESSION" | grep -q openbox); then
+  elif echo "$SESSION" | grep -q openbox; then
       # if openbox isn't in the session then append it
       SESSION="${SESSION%]},openbox]"
   fi
@@ -46,7 +46,7 @@ else
   OB_SESSION=$(gconftool-2 -g $SPATH/openbox_session 2> /dev/null)
 
   # update the GNOME/Openbox session if needed
-  if x$OB_SESSION != x$SESSION; then
+  if test x$OB_SESSION != x$SESSION; then
       # the default session changed or we didn't run GNOME/Openbox before
       gconftool-2 -t list --list-type=strings -s $SPATH/openbox_session \
         "$SESSION" 2> /dev/null