From 57f917f8934d441ebb6501c4691a2b59fa217f3f Mon Sep 17 00:00:00 2001 From: Robert Macomber Date: Fri, 16 Jan 2009 01:27:50 +0100 Subject: startx: fix misparsing of initial client and server arguments which begin with / or ./ If you invoke startx with a client whose initial command-line arguments begin with / or ./, it uses the last such argument as the base command for the client. E.g.: startx /usr/bin/xterm /usr/bin/mutt will use /usr/bin/mutt as the client to run instead of /usr/bin/xterm. This is because of the way in which startx parses its arguments. It's a loop over a case with three clauses; the bug is in the first. When it's looking at one of startx's args it checks to see if $clientargs is empty in order to see if it should set $client or add the argument to $clientargs. It should also check to see whether $client is set. There is a similar bug in parsing server args, where it checks to see if $serverargs is empty to decide whether to set $server. Debian bug#511717 (http://bugs.debian.org/511717) Signed-off-by: Julien Cristau --- startx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'startx.cpp') diff --git a/startx.cpp b/startx.cpp index 8a44965..f911499 100644 --- a/startx.cpp +++ b/startx.cpp @@ -162,13 +162,13 @@ while [ x"$1" != x ]; do XCOMM '' required to prevent cpp from treating "/*" as a C comment. /''*|\./''*) if [ "$whoseargs" = "client" ]; then - if [ x"$clientargs" = x ]; then + if [ x"$client" = x ] && [ x"$clientargs" = x ]; then client="$1" else clientargs="$clientargs $1" fi else - if [ x"$serverargs" = x ]; then + if [ x"$server" = x ] && [ x"$serverargs" = x ]; then server="$1" else serverargs="$serverargs $1" -- cgit v1.2.3