Skip to content

Commit 726f2ba

Browse files
Unescape special characters in dependency files
When a path contains spaces (or other special characters, probably), gcc escapes them with a \ in the generated .d files. This previously caused problems when parsing these files, causing recompiles to happen even when not needed. This applies a rather simple approach to unescaping these strings, which seems to be sufficient because the file format of the .d files is so predictable (e.g., we don't actually split on colons or spaces when parsing it).
1 parent 245d879 commit 726f2ba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: app/src/processing/app/debug/Compiler.java

+3
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,9 @@ private boolean isAlreadyCompiled(File src, File obj, File dep, Map<String, Stri
297297
line = line.substring(0, line.length() - 1);
298298
}
299299
line = line.trim();
300+
// Strip backslash escape sequences. This replaces \\ with \ and
301+
// removes all other backslashes
302+
line = line.replaceAll("\\\\(.)", "$1");
300303
if (line.length() == 0) continue; // ignore blank lines
301304
if (need_obj_parse) {
302305
// line is supposed to be the object file - make sure it really is!

0 commit comments

Comments
 (0)