Index: trunk/qmake/cachekeys.h
===================================================================
--- trunk/qmake/cachekeys.h	(revision 362)
+++ trunk/qmake/cachekeys.h	(revision 363)
@@ -48,5 +48,4 @@
 #include <qfile.h>
 #include <qfileinfo.h>
-#include <qdir.h>
 #include <qhash.h>
 
@@ -108,7 +107,4 @@
             return true;
 
-#ifdef Q_OS_OS2
-        return QDir::isRelativePath(file);
-#else
         const QChar c0 = file.at(0);
         const QChar c1 = length >= 2 ? file.at(1) : QChar(0);
@@ -118,5 +114,4 @@
                 || (c0 == QLatin1Char('/') && c1 == QLatin1Char('/'))
                 || (c0 == QLatin1Char('\\') && c1 == QLatin1Char('\\')));
-#endif    
     }
 };
Index: trunk/qmake/generators/makefile.cpp
===================================================================
--- trunk/qmake/generators/makefile.cpp	(revision 362)
+++ trunk/qmake/generators/makefile.cpp	(revision 363)
@@ -125,5 +125,5 @@
     }
     bool ret = true;
-#if defined(Q_OS_WIN)
+#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
     bool driveExists = true;
     if(!QDir::isRelativePath(path)) {
@@ -138,11 +138,4 @@
     }
     if(driveExists)
-#elif defined(Q_OS_OS2)
-    path = QFileInfo(path).absoluteFilePath();
-    QString drv = path.left(3);
-    if (!QFile::exists(drv))
-        warn_msg(WarnLogic, "Cannot access drive '%s' (%s)",
-                 drv.toLocal8Bit().data(), path.toLocal8Bit().data());
-    else
 #endif
     {
@@ -348,8 +341,12 @@
                         vpath += Option::output_dir;
                 }
-                foreach(const QString &vp, vpath) {
-                    QString real_val = QDir(vp).absoluteFilePath(val);
-                    if (exists(real_val)) {
-                        val = real_val;
+                for(QStringList::Iterator vpath_it = vpath.begin();
+                    vpath_it != vpath.end(); ++vpath_it) {
+                    QString real_dir = Option::fixPathToLocalOS((*vpath_it));
+                    if(exists(real_dir + QDir::separator() + val)) {
+                        QString dir = (*vpath_it);
+                        if(dir.right(Option::dir_sep.length()) != Option::dir_sep)
+                            dir += Option::dir_sep;
+                        val = dir + val;
                         if(!(flags & VPATH_NoFixify))
                             val = fileFixify(val);
@@ -853,5 +850,5 @@
                     file = libinfo.first("QMAKE_PRL_TARGET");
                     if(QDir::isRelativePath(file))
-                        file = QDir(dir).absoluteFilePath(file);
+                        file.prepend(dir);
                 }
             }
@@ -2737,22 +2734,4 @@
 }
 
-inline static bool pathEquals(const QString &path1, const QString &path2)
-{
-#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
-    return path1.compare(path2, Qt::CaseInsensitive) == 0;
-#else
-    return path1 == path2;
-#endif
-}
-
-inline static bool pathStartsWith(const QString &path1, const QString &path2)
-{
-#if defined(Q_OS_WIN) || defined(Q_OS_OS2)
-    return path1.toLower().startsWith(path2.toLower());
-#else
-    return path1.startsWith(path2);
-#endif
-}
-
 QString
 MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const QString &in_d,
@@ -2785,5 +2764,5 @@
     if(fix == FileFixifyAbsolute || (fix == FileFixifyDefault && project->isActiveConfig("no_fixpath"))) {
         if(fix == FileFixifyAbsolute && QDir::isRelativePath(ret)) //already absolute
-            ret = QDir(pwd).absoluteFilePath(ret);
+            ret.prepend(pwd);
         ret = Option::fixPathToTargetOS(ret, false, canon);
     } else { //fix it..
@@ -2803,15 +2782,15 @@
         if(out_dir != in_dir || !qfileinfo.isRelative()) {
             if(qfileinfo.isRelative()) {
-                ret = QDir(in_dir).absoluteFilePath(qfile);
+                ret = in_dir + "/" + qfile;
                 qfileinfo.setFile(ret);
             }
             ret = Option::fixPathToTargetOS(ret, false, canon);
             if(canon && qfileinfo.exists() &&
-               pathEquals(file, Option::fixPathToTargetOS(ret, true, canon)))
+               file == Option::fixPathToTargetOS(ret, true, canon))
                 ret = Option::fixPathToTargetOS(qfileinfo.canonicalFilePath());
             QString match_dir = Option::fixPathToTargetOS(out_dir, false, canon);
-            if(pathEquals(ret, match_dir)) {
+            if(ret == match_dir) {
                 ret = "";
-            } else if(pathStartsWith(ret, match_dir + Option::dir_sep)) {
+            } else if(ret.startsWith(match_dir + Option::dir_sep)) {
                 ret = ret.mid(match_dir.length() + Option::dir_sep.length());
             } else {
@@ -2834,5 +2813,5 @@
                     if(match_dir.isEmpty())
                         break;
-                    if(pathStartsWith(ret, match_dir + Option::dir_sep)) {
+                    if(ret.startsWith(match_dir + Option::dir_sep)) {
                         //concat
                         int remlen = ret.length() - (match_dir.length() + 1);
@@ -3025,5 +3004,5 @@
         if(!file.fileName().isEmpty()) {
             if(QDir::isRelativePath(file.fileName()))
-                file.setFileName(QDir(Option::output_dir).absoluteFilePath(file.fileName())); //pwd when qmake was run
+                file.setFileName(Option::output_dir + "/" + file.fileName()); //pwd when qmake was run
             QFileInfo fi(fileInfo(file.fileName()));
             if(fi.isDir())
@@ -3038,5 +3017,9 @@
     }
     if(QDir::isRelativePath(file.fileName())) {
-        file.setFileName(QDir(Option::output_dir).absoluteFilePath(file.fileName())); //pwd when qmake was run
+        QString fname = Option::output_dir;  //pwd when qmake was run
+        if(!fname.endsWith("/"))
+            fname += "/";
+        fname += file.fileName();
+        file.setFileName(fname);
     }
     if(!build.isEmpty())
@@ -3056,5 +3039,5 @@
         od = Option::fixPathToTargetOS(od);
         if(QDir::isRelativePath(od))
-            od = QDir(Option::output_dir).absoluteFilePath(od);
+            od.prepend(Option::output_dir);
         Option::output_dir = od;
         return true;
Index: trunk/qmake/generators/makefiledeps.cpp
===================================================================
--- trunk/qmake/generators/makefiledeps.cpp	(revision 362)
+++ trunk/qmake/generators/makefiledeps.cpp	(revision 363)
@@ -625,5 +625,9 @@
                     if(try_local) {
                         QString dir = findFileInfo(file->file).path();
-                        QMakeLocalFileName f(QDir(dir).absoluteFilePath(lfn.local()));
+                        if(QDir::isRelativePath(dir))
+                            dir.prepend(qmake_getpwd() + "/");
+                        if(!dir.endsWith("/"))
+                            dir += "/";
+                        QMakeLocalFileName f(dir + lfn.local());
                         if(findFileInfo(f).exists()) {
                             lfn = fixPathForFile(f);
@@ -632,6 +636,6 @@
                     }
                     if(!exists) { //path lookup
-                        foreach(const QMakeLocalFileName &dd, depdirs) {
-                            QMakeLocalFileName f(QDir(dd.real()).absoluteFilePath(lfn.real()));
+                        for(QList<QMakeLocalFileName>::Iterator it = depdirs.begin(); it != depdirs.end(); ++it) {
+                            QMakeLocalFileName f((*it).real() + Option::dir_sep + lfn.real());
                             QFileInfo fi(findFileInfo(f));
                             if(fi.exists() && !fi.isDir()) {
Index: trunk/qmake/generators/metamakefile.cpp
===================================================================
--- trunk/qmake/generators/metamakefile.cpp	(revision 362)
+++ trunk/qmake/generators/metamakefile.cpp	(revision 363)
@@ -325,5 +325,5 @@
             sub->input_dir = subdir.absolutePath();
             if(subdir.isRelative() && old_output_dir != oldpwd) {
-                sub->output_dir = QDir(old_output_dir).absoluteFilePath(subdir.path());
+                sub->output_dir = old_output_dir + "/" + subdir.path();
                 printf("Reading %s [%s]\n", subdir.absoluteFilePath().toLatin1().constData(), sub->output_dir.toLatin1().constData());
             } else { //what about shadow builds?
Index: trunk/qmake/generators/win32/winmakefile.cpp
===================================================================
--- trunk/qmake/generators/win32/winmakefile.cpp	(revision 362)
+++ trunk/qmake/generators/win32/winmakefile.cpp	(revision 363)
@@ -246,5 +246,5 @@
                         tmp = opt;
                     for(QList<QMakeLocalFileName>::Iterator it = libdirs.begin(); it != libdirs.end(); ++it) {
-                        QString prl = QDir((*it).local()).absoluteFilePath(tmp);
+                        QString prl = (*it).local() + Option::dir_sep + tmp;
                         // the original is used as the key
                         QString orgprl = prl;
Index: trunk/qmake/main.cpp
===================================================================
--- trunk/qmake/main.cpp	(revision 362)
+++ trunk/qmake/main.cpp	(revision 363)
@@ -127,5 +127,5 @@
             Option::output_dir = dir;
         if(QDir::isRelativePath(Option::output_dir))
-            Option::output_dir = QDir(oldpwd).absoluteFilePath(Option::output_dir);
+            Option::output_dir.prepend(oldpwd);
         Option::output_dir = QDir::cleanPath(Option::output_dir);
     }
Index: trunk/qmake/meta.cpp
===================================================================
--- trunk/qmake/meta.cpp	(revision 362)
+++ trunk/qmake/meta.cpp	(revision 363)
@@ -163,5 +163,5 @@
                         QString targ = dirs[i] + (*lst_it);
                         if(QDir::isRelativePath(targ))
-                            targ = QDir(qmake_getpwd()).absoluteFilePath(targ);
+                            targ.prepend(qmake_getpwd() + QDir::separator());
                         vars["QMAKE_PRL_TARGET"] << targ;
                         found = true;
Index: trunk/qmake/project.cpp
===================================================================
--- trunk/qmake/project.cpp	(revision 362)
+++ trunk/qmake/project.cpp	(revision 363)
@@ -1457,23 +1457,20 @@
                 if (QFile::exists(qmakespec+"/qmake.conf")) {
                     Option::mkfile::qmakespec = QFileInfo(Option::mkfile::qmakespec).absoluteFilePath();
+                } else if (QFile::exists(Option::output_dir+"/"+qmakespec+"/qmake.conf")) {
+                    qmakespec = Option::mkfile::qmakespec = QFileInfo(Option::output_dir+"/"+qmakespec).absoluteFilePath();
                 } else {
-                    QString tmp = QDir(Option::output_dir).absoluteFilePath(qmakespec);
-                    if (QFile::exists(tmp+"/qmake.conf"))
-                        qmakespec = Option::mkfile::qmakespec = tmp;
-                    else {
-                        bool found_mkspec = false;
-                        foreach(const QString &root, mkspec_roots) {
-                            QString mkspec = QDir(root).absoluteFilePath(qmakespec);
-                            if(QFile::exists(mkspec)) {
-                                found_mkspec = true;
-                                Option::mkfile::qmakespec = qmakespec = mkspec;
-                                break;
-                            }
+                    bool found_mkspec = false;
+                    for(QStringList::ConstIterator it = mkspec_roots.begin(); it != mkspec_roots.end(); ++it) {
+                        QString mkspec = (*it) + QDir::separator() + qmakespec;
+                        if(QFile::exists(mkspec)) {
+                            found_mkspec = true;
+                            Option::mkfile::qmakespec = qmakespec = mkspec;
+                            break;
                         }
-                        if(!found_mkspec) {
-                            fprintf(stderr, "Could not find mkspecs for your QMAKESPEC(%s) after trying:\n\t%s\n",
-                                    qmakespec.toLatin1().constData(), mkspec_roots.join("\n\t").toLatin1().constData());
-                            return false;
-                        }
+                    }
+                    if(!found_mkspec) {
+                        fprintf(stderr, "Could not find mkspecs for your QMAKESPEC(%s) after trying:\n\t%s\n",
+                                qmakespec.toLatin1().constData(), mkspec_roots.join("\n\t").toLatin1().constData());
+                        return false;
                     }
                 }
@@ -1778,6 +1775,9 @@
             include_roots << qmake_getpwd();
         include_roots << Option::output_dir;
-        foreach(const QString &root, include_roots) {
-            QString testName = QDir(root).absoluteFilePath(file);
+        for(int root = 0; root < include_roots.size(); ++root) {
+            QString testName = QDir::toNativeSeparators(include_roots[root]);
+            if (!testName.endsWith(QString(QDir::separator())))
+                testName += QDir::separator();
+            testName += file;
             if(QFile::exists(testName)) {
                 file = testName;
Index: trunk/src/corelib/io/qdir.cpp
===================================================================
--- trunk/src/corelib/io/qdir.cpp	(revision 362)
+++ trunk/src/corelib/io/qdir.cpp	(revision 363)
@@ -732,49 +732,4 @@
 {
     Q_D(const QDir);
-
-#ifdef Q_OS_OS2
-
-    if (isAbsolutePath(fileName) || !d->data->fileEngine)
-        return QDir::fromNativeSeparators(fileName);
-
-    // On OS/2, paths like "A:bbb.txt" and "\ccc.dat" are not absolute and
-    // therefore require special processing here
-    QString ret;
-    if (isRelativePath(d->data->path)) {
-        if (d->data->path.startsWith(QLatin1Char('/')) ||
-            (d->data->path.length() >= 2 &&
-             d->data->path.at(0).isLetter() && d->data->path.at(1) == QLatin1Char(':'))) {
-            ret = d->data->fileEngine->fileName(QAbstractFileEngine::AbsoluteName);
-        } else {
-#ifndef QT_NO_FSFILEENGINE
-            //get pwd
-            ret = QFSFileEngine::currentPath(fileName);
-#endif
-            if(!d->data->path.isEmpty() && d->data->path != QLatin1String(".")) {
-                if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
-                    ret += QLatin1Char('/');
-                ret += d->data->path;
-            }
-        }
-    } else {
-        ret = d->data->path;
-    }
-    if (!fileName.isEmpty()) {
-        QString fn = QDir::fromNativeSeparators(fileName);
-        if (fn.length() >= 2 &&
-            fn.at(0).isLetter() && fn.at(1) == QLatin1Char(':')) {
-            ret = QFileInfo(fn).absoluteFilePath();
-        } else {
-            if (fn.startsWith(QLatin1Char('/')) && !ret.isEmpty())
-                ret = ret.left(2); // take the drive name
-            else if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
-                ret += QLatin1Char('/'); // append the missing slash
-            ret += fn;
-        }
-    }
-    return ret;
-
-#else // #ifdef Q_OS_OS2
-
     if (isAbsolutePath(fileName))
         return fileName;
@@ -798,6 +753,4 @@
     }
     return ret;
-
-#endif // #ifdef Q_OS_OS2
 }
 
Index: trunk/src/corelib/io/qfileinfo.cpp
===================================================================
--- trunk/src/corelib/io/qfileinfo.cpp	(revision 362)
+++ trunk/src/corelib/io/qfileinfo.cpp	(revision 363)
@@ -586,6 +586,6 @@
     drive letter, except for network shares that are not mapped to a
     drive letter, in which case the path will begin '//sharename/'.
-    QFileInfo will uppercase drive letters. Note that QDir does not
-    normally do this. The code snippet below shows this.
+    QFileInfo will uppercase drive letters. Note that QDir does not do
+    this. The code snippet below shows this.
 
     \snippet doc/src/snippets/code/src_corelib_io_qfileinfo.cpp newstuff
Index: trunk/src/corelib/io/qfsfileengine_os2.cpp
===================================================================
--- trunk/src/corelib/io/qfsfileengine_os2.cpp	(revision 362)
+++ trunk/src/corelib/io/qfsfileengine_os2.cpp	(revision 363)
@@ -650,10 +650,8 @@
 static bool isRelativePath(const QString &path)
 {
-	// On OS/2, "A:bbb.txt" and "/ccc.dat" are relative paths
-    return !(path.startsWith(QLatin1String("//")) ||
-             (path.length() >= 2 && path.at(0).isLetter() &&
-              path.at(1) == QLatin1Char(':') &&
-              // we treat "D:" as absolute while "D:aaa" as relative
-              (path.length() == 2 || path.at(2) == QLatin1Char('/'))));
+    return !(path.startsWith(QLatin1Char('/'))
+        || (path.length() >= 2
+        && ((path.at(0).isLetter() && path.at(1) == QLatin1Char(':'))
+        || (path.at(0) == QLatin1Char('/') && path.at(1) == QLatin1Char('/')))));                // drive, e.g. a:
 }
 
@@ -688,38 +686,29 @@
     } else if(file == AbsoluteName || file == AbsolutePathName) {
         QString ret;
-        if (isRelativePath()) {
-            if ((d->filePath.size() > 2 && d->filePath.at(1) == QLatin1Char(':') &&
-                 d->filePath.at(2) != QLatin1Char('/')) ||    // path relative to the current dir of the given drive, so Z:a.txt -> Z:\currentpath\a.txt
-                (d->filePath.startsWith(QLatin1Char('/')))) { // path relative to the root of the current drive, so \a.txt -> Z:\a.txt
+
+        if (!isRelativePath()) {
+            if (d->filePath.size() > 2 && d->filePath.at(1) == QLatin1Char(':')
+                && d->filePath.at(2) != QLatin1Char('/') || // It's a drive-relative path, so Z:a.txt -> Z:\currentpath\a.txt
+                d->filePath.startsWith(QLatin1Char('/'))    // It's a absolute path to the current drive, so \a.txt -> Z:\a.txt
+                ) {
                 char buf[PATH_MAX+1];
                 strcpy(buf, QFile::encodeName(d->filePath).constData());
                 _abspath(buf, buf, sizeof(buf));
-                ret = QDir::cleanPath(QFile::decodeName(buf));
-                if (::isRelativePath(ret)) {
-                    // still relative, this means we have "Z:aaa" but there is no such drive Z:
-                    // just assume root is the current dir on Z:
-                    Q_ASSERT(ret.at(1) == QLatin1Char(':'));
-                    ret.insert(2, QLatin1Char('/'));
-                }
+                ret = QFile::decodeName(buf);
             } else {
-                ret = QDir::cleanPath(QDir::currentPath() + QLatin1Char('/') + d->filePath);
+                ret = d->filePath;
             }
         } else {
-            ret = d->filePath;
+            ret = QDir::cleanPath(QDir::currentPath() + QLatin1Char('/') + d->filePath);
         }
 
         // The path should be absolute at this point.
-        // On OS/2, the absolute path always contains a "X:/" at the begining
-        // where X is the drive letter, or "//" if it's a network share
-        if (!ret.startsWith(QLatin1String("//"))) {
+        // From the docs :
+        // Absolute paths begin with the directory separator "/"
+        // (optionally preceded by a drive specification under Windows).
+        if (ret.at(0) != QLatin1Char('/')) {
             Q_ASSERT(ret.length() >= 2);
             Q_ASSERT(ret.at(0).isLetter());
             Q_ASSERT(ret.at(1) == QLatin1Char(':'));
-            if (ret.length() == 2) {
-                // we are missing the slash in the "drive root dir" case, append it
-                ret += QLatin1Char('/');
-            } else {
-                Q_ASSERT(ret.at(2) == QLatin1Char('/'));
-            }
 
             // Force uppercase drive letters.
@@ -729,17 +718,10 @@
         if (file == AbsolutePathName) {
             int slash = ret.lastIndexOf(QLatin1Char('/'));
-            if (!ret.startsWith(QLatin1String("//"))) {
-                Q_ASSERT(slash >= 2);
-                if (slash == 2)
-                    ret = ret.left(3);  // include the slash if it's "X:/"
-                else
-                    ret = ret.left(slash);
-            } else {
-                Q_ASSERT(slash >= 1);
-                if (slash == 1)
-                    ret = ret.left(3);  // include the slash if it's "//"
-                else
-                    ret = ret.left(slash);
-            }
+            if (slash < 0)
+                return ret;
+            else if (ret.at(0) != QLatin1Char('/') && slash == 2)
+                return ret.left(3);      // include the slash
+            else
+                return ret.left(slash > 0 ? slash : 1);
         }
         return ret;
@@ -751,17 +733,9 @@
         if (!ret.isEmpty() && file == CanonicalPathName) {
             int slash = ret.lastIndexOf(QLatin1Char('/'));
-            if (!ret.startsWith(QLatin1String("//"))) {
-                Q_ASSERT(slash >= 2);
-                if (slash == 2)
-                    ret = ret.left(3);  // include the slash if it's "X:/"
-                else
-                    ret = ret.left(slash);
-            } else {
-                Q_ASSERT(slash >= 1);
-                if (slash == 1)
-                    ret = ret.left(3);  // include the slash if it's "//"
-                else
-                    ret = ret.left(slash);
-            }
+            if (slash == -1)
+                ret = QDir::currentPath();
+            else if (slash == 0)
+                ret = QLatin1String("/");
+            ret = ret.left(slash);
         }
         return ret;
@@ -774,58 +748,47 @@
                 QString target = QDir::fromNativeSeparators(QFile::decodeName(QByteArray(buf)));
                 QString ret;
-                if (::isRelativePath(target)) {
-                    if ((target.size() > 2 && target.at(1) == QLatin1Char(':') &&
-                         target.at(2) != QLatin1Char('/')) ||    // path relative to the current dir of the given drive, so Z:a.txt -> Z:\currentpath\a.txt
-                        (target.startsWith(QLatin1Char('/')))) { // path relative to the root of the current drive, so \a.txt -> Z:\a.txt
+                if (!::isRelativePath(target)) {
+                    if (target.size() > 2 && target.at(1) == QLatin1Char(':')
+                        && target.at(2) != QLatin1Char('/') || // It's a drive-relative path, so Z:a.txt -> Z:\currentpath\a.txt
+                        target.startsWith(QLatin1Char('/'))    // It's a absolute path to the current drive, so \a.txt -> Z:\a.txt
+                        ) {
                         char buf[PATH_MAX+1];
                         strcpy(buf, QFile::encodeName(target).constData());
                         _abspath(buf, buf, sizeof(buf));
-                        ret = QDir::cleanPath(QFile::decodeName(buf));
-                        if (::isRelativePath(ret)) {
-                            // still relative, this means we have "Z:aaa" but there is no such drive Z:
-                            // just assume root is the current dir on Z:
-                            Q_ASSERT(ret.at(1) == QLatin1Char(':'));
-                            ret.insert(2, QLatin1Char('/'));
-                        }
+                        ret = QFile::decodeName(buf);
                     } else {
-                        if (S_ISDIR(d->st.st_mode)) {
-                            QDir parent(d->filePath);
-                            parent.cdUp();
-                            ret = parent.path();
-                            if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
-                                ret += QLatin1Char('/');
-                        }
-                        ret += target;
-
-                        if (::isRelativePath(ret)) {
-                            if (!isRelativePath()) {
-                                ret.prepend(d->filePath.left(d->filePath.lastIndexOf(QLatin1Char('/')))
-                                            + QLatin1Char('/'));
-                            } else {
-                                ret.prepend(QDir::currentPath() + QLatin1Char('/'));
-                            }
-                        }
-                        ret = QDir::cleanPath(ret);
-                        if (ret.size() > 1 && ret.endsWith(QLatin1Char('/')))
-                            ret.chop(1);
+                        ret = target;
                     }
                 } else {
-                    ret = target;
+                    if (S_ISDIR(d->st.st_mode)) {
+                        QDir parent(d->filePath);
+                        parent.cdUp();
+                        ret = parent.path();
+                        if (!ret.isEmpty() && !ret.endsWith(QLatin1Char('/')))
+                            ret += QLatin1Char('/');
+                    }
+                    ret += target;
+
+                    if (::isRelativePath(ret)) {
+                        if (!isRelativePath()) {
+                            ret.prepend(d->filePath.left(d->filePath.lastIndexOf(QLatin1Char('/')))
+                                        + QLatin1Char('/'));
+                        } else {
+                            ret.prepend(QDir::currentPath() + QLatin1Char('/'));
+                        }
+                    }
+                    ret = QDir::cleanPath(ret);
+                    if (ret.size() > 1 && ret.endsWith(QLatin1Char('/')))
+                        ret.chop(1);
                 }
 
-
                 // The path should be absolute at this point.
-                // On OS/2, the absolute path always contains a "X:/" at the begining
-                // where X is the drive letter, or "//" if it's a network share
-                if (!ret.startsWith(QLatin1String("//"))) {
+                // From the docs :
+                // Absolute paths begin with the directory separator "/"
+                // (optionally preceded by a drive specification under Windows).
+                if (ret.at(0) != QLatin1Char('/')) {
                     Q_ASSERT(ret.length() >= 2);
                     Q_ASSERT(ret.at(0).isLetter());
                     Q_ASSERT(ret.at(1) == QLatin1Char(':'));
-                    if (ret.length() == 2) {
-                        // we are missing the slash in the "drive root dir" case, append it
-                        ret += QLatin1Char('/');
-                    } else {
-                        Q_ASSERT(ret.at(2) == QLatin1Char('/'));
-                    }
 
                     // Force uppercase drive letters.
