From 8501ffbb36525fb9d62ff9589781065d017cf956 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Fri, 24 Jun 2016 13:47:39 +0200 Subject: [PATCH] WorkingDirectoryAspect: Expand macros first, then expand variables Expanding variables includes calling cleanPath on the input. At that point macros like %{buildDir} need to be expanded already or working directories like "%{buildDir}/../test" will get turned into "test", which is not what a user expects to happen. Change-Id: I61e6604a621f632ddee87766d38ab3c863bdb9dc Reviewed-by: hjk --- src/plugins/projectexplorer/runconfigurationaspects.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/runconfigurationaspects.cpp b/src/plugins/projectexplorer/runconfigurationaspects.cpp index 7e935be8c2d..11e6c10c8b8 100644 --- a/src/plugins/projectexplorer/runconfigurationaspects.cpp +++ b/src/plugins/projectexplorer/runconfigurationaspects.cpp @@ -218,9 +218,9 @@ FileName WorkingDirectoryAspect::workingDirectory() const auto envAspect = runConfiguration()->extraAspect(); const Utils::Environment env = envAspect ? envAspect->environment() : Utils::Environment::systemEnvironment(); - return FileName::fromString( - runConfiguration()->macroExpander()->expandProcessArgs( - PathChooser::expandedDirectory(m_workingDirectory.toString(), env, QString()))); + const QString macroExpanded + = runConfiguration()->macroExpander()->expandProcessArgs(m_workingDirectory.toUserOutput()); + return FileName::fromString(PathChooser::expandedDirectory(macroExpanded, env, QString())); } FileName WorkingDirectoryAspect::defaultWorkingDirectory() const