From: Manuel Nickschas Date: Sat, 14 Mar 2009 22:49:14 +0000 (+0100) Subject: Properly handle whitespace in script paths X-Git-Tag: 0.5-rc1~279 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=4d1ce9deedfc96b261ad2f209715549284821a37;hp=b19c2a813430ea8030dc66eb3343c727c2124db9;ds=sidebyside Properly handle whitespace in script paths --- diff --git a/src/client/execwrapper.cpp b/src/client/execwrapper.cpp index cf5ac964..4958eb6c 100644 --- a/src/client/execwrapper.cpp +++ b/src/client/execwrapper.cpp @@ -50,14 +50,14 @@ void ExecWrapper::start(const BufferInfo &info, const QString &command) { // Make sure we don't execute something outside a script dir if(_scriptName.contains("../") || _scriptName.contains("..\\")) - emit error(tr("Name \"%1\" is invalid: / or ../ are not allowed!").arg(_scriptName)); + emit error(tr("Name \"%1\" is invalid: ../ or ..\\ are not allowed!").arg(_scriptName)); else { foreach(QString scriptDir, Quassel::scriptDirPaths()) { QString fileName = scriptDir + _scriptName; if(!QFile::exists(fileName)) continue; - _process.start(fileName + ' ' + params); + _process.start('"' + fileName + "\" " + params); return; } emit error(tr("Could not find script \"%1\"").arg(_scriptName));