From 75f1dd8b9c4b05528496720f83c2fe7e17ffddd0 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Thu, 27 Jul 2017 11:14:55 +0200 Subject: [PATCH] Core: check whether the patch tool defined in settings exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9b910ddfc9250b1d558bbe56c8cf82da056344ff Reviewed-by: Oliver Wolff Reviewed-by: André Hartmann Reviewed-by: Orgad Shaneh Reviewed-by: Leena Miettinen --- src/plugins/coreplugin/patchtool.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/coreplugin/patchtool.cpp b/src/plugins/coreplugin/patchtool.cpp index 10a48817def..724fabd1335 100644 --- a/src/plugins/coreplugin/patchtool.cpp +++ b/src/plugins/coreplugin/patchtool.cpp @@ -88,6 +88,12 @@ static bool runPatchHelper(const QByteArray &input, const QString &workingDirect return false; } + if (!Utils::FileName::fromString(patch).exists() + && !Utils::Environment::systemEnvironment().searchInPath(patch).exists()) { + MessageManager::write(QApplication::translate("Core::PatchTool", "The patch-command configured in the general \"Environment\" settings does not exist.")); + return false; + } + QProcess patchProcess; if (!workingDirectory.isEmpty()) patchProcess.setWorkingDirectory(workingDirectory);