From 26e859be8196902264a96d487a35d6a294760b14 Mon Sep 17 00:00:00 2001 From: bb010g Date: Tue, 14 Dec 2021 14:01:53 -0800 Subject: [PATCH] qmake: Teach escapeFilePath to escape quotes Otherwise, Make is unhappy. For example: ``` 13:42:49: Starting: "/usr/bin/make" clean -j8 /Users/alice/Qt/5.15.7/clang_64/bin/qmake -o Makefile ../Alice's\ Project.pro /bin/sh: -c: line 0: unexpected EOF while looking for matching `'' /bin/sh: -c: line 1: syntax error: unexpected end of file make: *** [Makefile] Error 2 13:42:49: The process "/usr/bin/make" exited with code 2. ``` --- qmake/generators/unix/unixmake.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 07f8d861dc6..53cd620dcb8 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -767,7 +767,9 @@ UnixMakefileGenerator::escapeFilePath(const QString &path) const QString ret = path; if(!ret.isEmpty()) { ret.replace(QLatin1Char(' '), QLatin1String("\\ ")) - .replace(QLatin1Char('\t'), QLatin1String("\\\t")); + .replace(QLatin1Char('\t'), QLatin1String("\\\t")) + .replace(QLatin1Char('\''), QLatin1String("\\'")) + .replace(QLatin1Char('"'), QLatin1String("\\\"")); debug_msg(2, "EscapeFilePath: %s -> %s", path.toLatin1().constData(), ret.toLatin1().constData()); } return ret;