Changeset 934


Ignore:
Timestamp:
Aug 2, 2011, 4:28:07 PM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

qmake: gnumake/os2: Don't escape paths with make vars.

This is a regression of r909. Paths in such vars should be already
quoted and escaped so it is an error to do it twice. This in particular
affected DEL_FILE statements in clean targets by quoting paths like
"$(basename $(DESTDIR_TARGET)).map".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qmake/generators/os2/gnumake.cpp

    r912 r934  
    7171QString GNUMakefileGenerator::escapeFilePath(const QString &path) const
    7272{
    73     QString ret = Option::fixPathToTargetOS(path, false);
    74     if (!isDosLikeShell()) {
    75         ret.remove('\"');
    76         ret.replace('\\', '/');
    77         ret.replace(' ', "\\ ");
    78     } else {
    79         ret.replace(QRegExp("\""), "");
    80         ret.replace(QRegExp("[\\\\/]$"), "");
    81         if (ret.contains(QRegExp("[ +&;%]")))
    82             ret = quote + ret + quote;
     73    QString ret = path;
     74    // we assume that make variables contain paths already properly escaped
     75    if (!path.contains(QRegExp("\\$\\(([^$)]+)\\)"))) {
     76        ret = Option::fixPathToTargetOS(path, false);
     77        if (!isDosLikeShell()) {
     78            ret.remove('\"');
     79            ret.replace('\\', '/');
     80            ret.replace(' ', "\\ ");
     81        } else {
     82            ret.replace(QRegExp("\""), "");
     83            ret.replace(QRegExp("[\\\\/]$"), "");
     84            if (ret.contains(QRegExp("[ +&;%]")))
     85                ret = quote + ret + quote;
     86        }
    8387    }
    8488    return ret;
Note: See TracChangeset for help on using the changeset viewer.