forked from qt-creator/qt-creator
Introduce Utils::SynchronousProcess::normalizeNewlines
Replaces \r\n? with \n. Some console applications (e.g. git-push, git-rebase) use \r alone to move the cursor to the line's beginning. This should be replaced by \n rather than just be erased. Change-Id: I8d614d2b471e59decdbfa7f173ffa7fbdb11759b Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
1b13122cd1
commit
208aeb79ed
@@ -744,9 +744,7 @@ Core::IEditor *locateEditor(const char *property, const QString &entry)
|
||||
// Return converted command output, remove '\r' read on Windows
|
||||
static inline QString commandOutputFromLocal8Bit(const QByteArray &a)
|
||||
{
|
||||
QString output = QString::fromLocal8Bit(a);
|
||||
output.remove(QLatin1Char('\r'));
|
||||
return output;
|
||||
return Utils::SynchronousProcess::normalizeNewlines(QString::fromLocal8Bit(a));
|
||||
}
|
||||
|
||||
// Return converted command output split into lines
|
||||
@@ -3398,7 +3396,7 @@ QString GitClient::readConfig(const QString &workingDirectory, const QStringList
|
||||
VcsBasePlugin::SuppressCommandLogging))
|
||||
return QString();
|
||||
if (Utils::HostOsInfo::isWindowsHost())
|
||||
return QString::fromUtf8(outputText).remove(QLatin1Char('\r'));
|
||||
return Utils::SynchronousProcess::normalizeNewlines(QString::fromUtf8(outputText));
|
||||
return commandOutputFromLocal8Bit(outputText);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user