forked from qt-creator/qt-creator
Utils: Treat FilePath with variables as user input when expanding
When macro-expanding FilePaths with environment variables, it can happen
that non-conformant path separators end up in the intermediate expanded
string. For example with "%{Env:PROGRAMFILES}" on Windows.
Since we generally treat paths from environment variables as user input,
it makes sense to treat macros as user input as-well in this case.
Change-Id: I0daa57b7dbf3d8fd25c98fb82b2beb1bc6ded825
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -275,7 +275,7 @@ QString MacroExpander::expand(const QString &stringWithVariables) const
|
|||||||
FilePath MacroExpander::expand(const FilePath &fileNameWithVariables) const
|
FilePath MacroExpander::expand(const FilePath &fileNameWithVariables) const
|
||||||
{
|
{
|
||||||
// We want single variables to expand to fully qualified strings.
|
// We want single variables to expand to fully qualified strings.
|
||||||
return FilePath::fromString(expand(fileNameWithVariables.toString()));
|
return FilePath::fromUserInput(expand(fileNameWithVariables.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray MacroExpander::expand(const QByteArray &stringWithVariables) const
|
QByteArray MacroExpander::expand(const QByteArray &stringWithVariables) const
|
||||||
|
|||||||
Reference in New Issue
Block a user