Fwd: [Bug 79628] minicli always uses /bin/sh, even if user sets SHELL

Oswald Buddenhagen ossi at kde.org
Wed Apr 14 13:00:35 BST 2004


On Wed, Apr 14, 2004 at 01:48:00PM +0200, David Faure wrote:
> Patch to use SHELL from environment if available
> 
this will certainly cause some surprises. whatever.

> --- kdebase/kdesktop/minicli.cpp.orig	2004-01-17 12:47:58.000000000 +0000
> +++ kdebase/kdesktop/minicli.cpp	2004-04-14 12:13:32.789746000 +0100
>
so far nothing particularily wrong, afaics.

>  QString Minicli::calculate(const QString &exp)
>  {
>     QString result;
> -   QString cmd = QString("echo $[%1]").arg(exp);
> +   QString cmd = QString("%1 -c %2").arg(getShell()).arg(KProcess::quote(QString("echo $[%2]").arg(exp)));
>
but this is plain wrong. we want a bourne/posix shell here.
fwiw, use $(()), not $[] (which is bash-specific).

greetings

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Chaos, panic, and disorder - my work here is done.




More information about the kde-core-devel mailing list