Changeset 214


Ignore:
Timestamp:
Oct 7, 2009, 8:33:54 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

corelib: QProcess: DosSearchPath() doesn't like file names with path in pszFilename and seems to always return "not found" in this case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/corelib/io/qprocess_os2.cpp

    r213 r214  
    822822        QStringList knownExts;
    823823        knownExts << "exe" << "cmd" << "bat"; // in order of CMD.EXE's precedence
    824         QByteArray path = QFile::encodeName(programInfo.path());
     824        QByteArray path =
     825            QFile::encodeName(QDir::toNativeSeparators(programInfo.path()));
     826        if (path == ".")
     827            path.clear();
    825828        // run through all known exe extensions (+ no extension case)
    826829        for (int i = 0; i <= knownExts.size(); ++i) {
     
    829832                // no extension case, only if a known extension is already there
    830833                if (knownExts.contains(programInfo.suffix(), Qt::CaseInsensitive))
    831                     name = programName;
     834                    name = QFile::encodeName(programInfo.fileName());
    832835                else
    833836                    continue;
    834837            } else {
    835                 name = QFile::encodeName(program + QLatin1String(".") + knownExts[i-1]);
     838                name = QFile::encodeName(programInfo.fileName() +
     839                                         QLatin1String(".") + knownExts[i-1]);
    836840            }
    837841            if (!path.isEmpty()) {
Note: See TracChangeset for help on using the changeset viewer.