Ignore:
Timestamp:
Sep 26, 2009, 1:28:06 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

qmake: gnumake/os2: Spaces in dependencies that are actually make variable references could be wrongly escaped with \ (affected RC_FILE processing).

File:
1 edited

Legend:

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

    r158 r194  
    8787QString GNUMakefileGenerator::escapeDependencyPath(const QString &path) const
    8888{
    89     /* dependency escaping is always done Unix-way since this is a requirement
    90      * of GNU make which allows " and ' to be part of the file name */
     89    // dependency escaping is always done Unix-way since this is a requirement
     90    // of GNU make which allows " and ' to be part of the file name.
     91    // Note that if the string is a make variable reference, we don't eascape!
    9192    QString ret = path;
    92     ret.remove('\"');
    93     ret.replace(' ', "\\ ");
     93    QString trimmed = path.trimmed();
     94    if (!trimmed.startsWith("$(") || !trimmed.endsWith(")")) {
     95        ret.remove('\"');
     96        ret.replace(' ', "\\ ");
     97    }
    9498    return ret;
    9599}
     
    695699    if (isDosLikeShell()) {
    696700        QString ret = vars;
    697         ret.replace(QRegExp("\\$\\((.+)\\)"), "$(call q,$(\\1))");
     701        QRegExp rx = QRegExp("\\$\\((.+)\\)");
     702        rx.setMinimal(true);
     703        ret.replace(rx, "$(call q,$(\\1))");
    698704        return ret;
    699705    }
Note: See TracChangeset for help on using the changeset viewer.