mirror of
https://github.com/KDE/konsole.git
synced 2026-05-03 20:26:45 -04:00
Quote arguments containing spaces when expanding the list of arguments
in a ShellCommand. BUG: 156826 BACKPORT: 4.1 svn path=/trunk/KDE/kdebase/apps/konsole/; revision=837723
This commit is contained in:
@@ -66,7 +66,18 @@ ShellCommand::ShellCommand(const QString& command , const QStringList& arguments
|
||||
}
|
||||
QString ShellCommand::fullCommand() const
|
||||
{
|
||||
return _arguments.join(QChar(' '));
|
||||
QStringList quotedArgs(_arguments);
|
||||
for (int i=0;i<quotedArgs.count();i++)
|
||||
{
|
||||
QString arg = quotedArgs.at(i);
|
||||
bool hasSpace = false;
|
||||
for (int j=0;j<arg.count();j++)
|
||||
if (arg[j].isSpace())
|
||||
hasSpace = true;
|
||||
if (hasSpace)
|
||||
quotedArgs[i] = '\"' + arg + '\"';
|
||||
}
|
||||
return quotedArgs.join(QChar(' '));
|
||||
}
|
||||
QString ShellCommand::command() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user