From 1982ab61a50908b60a5e41c8d086f07f68ed5d92 Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Date: Fri, 11 Dec 2009 17:04:13 +0100
Subject: [PATCH] Perforce: Test on Windows.

---
 src/plugins/perforce/perforceplugin.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp
index 350c0ffb9bd..ae859802790 100644
--- a/src/plugins/perforce/perforceplugin.cpp
+++ b/src/plugins/perforce/perforceplugin.cpp
@@ -600,6 +600,7 @@ void PerforcePlugin::startSubmitProject()
     }
 
     QStringList fstatLines = fstatResult.stdOut.split(QLatin1Char('\n'));
+qDebug() <<     "O" << fstatResult.stdOut << "L" << fstatLines;
     QStringList depotFileNames;
     foreach (const QString &line, fstatLines) {
         if (line.startsWith("... depotFile"))
@@ -972,6 +973,7 @@ PerforceResponse PerforcePlugin::fullySynchronousProcess(const QString &workingD
     }
     if (!stdInput.isEmpty()) {
         if (process.write(stdInput) == -1) {
+            PerforceChecker::ensureProcessStopped(process);
             response.error = true;
             response.message = tr("Unable to write input data to process %1: %2").arg(m_settings.p4Command(), process.errorString());
             return response;
@@ -996,6 +998,9 @@ PerforceResponse PerforcePlugin::fullySynchronousProcess(const QString &workingD
     const QByteArray stdOut = process.readAllStandardOutput();
     response.stdOut = outputCodec ? outputCodec->toUnicode(stdOut.constData(), stdOut.size()) :
                                     QString::fromLocal8Bit(stdOut);
+    const QChar cr = QLatin1Char('\r');
+    response.stdErr.remove(cr);
+    response.stdOut.remove(cr);
     // Logging
     VCSBase::VCSBaseOutputWindow *outputWindow = VCSBase::VCSBaseOutputWindow::instance();
     if ((flags & StdErrToWindow) && !response.stdErr.isEmpty())
-- 
GitLab