[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: quanta [POSSIBLY UNSAFE]
From: Waldo Bastian <bastian () kde ! org>
Date: 2002-12-08 10:46:14
[Download RAW message or body]
On Sunday 08 December 2002 11:35, Mantia Andras wrote:
> On 2002. December 08., Sunday 12:11, Waldo Bastian wrote:
> > On Sunday 08 December 2002 11:01, Andras Mantia wrote:
> > > QString args = arguments();
> > > + if (!args.isEmpty())
> > > + args = KProcess::quote(args);
> >
> > Are you sure that is correct? The name suggests that you can have
> > multiple arguments (like what?) but if you quote them they will be
> > interpreted as a single argument.
> >
> > Cheers,
> > Waldo
>
> Yes, you are right, and it breaks when you specify multiple arguments, but
> it does not always work even with one argument!
> KProcess::quote("~/dir/foo") returns '~/dir/foo', which is not good for
> apps. I've tried it with kompare and cat.
>
> andris@stein:~/cvs-developement/head/quanta> cat '~/.kderc'
> cat: ~/.kderc: No such file or directory
>
> Is this the desired behaviour of KProcess:quote()?
Yes, ~ is interpreted by the shell and expanded to your home dir, pretty much
like ${HOME}. Quoting it disables that.
If such arguments are provided by the user and constructs like ~/.kderc are
still supposed to work, then I would just leave it unquoted.
Cheers,
Waldo
--
bastian@kde.org -=|[ SuSE, The Linux Desktop Experts ]|=- bastian@suse.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic