MinGW Makefiles: Quote UNC paths on command lines

UNC paths (starting with `\\`) need quotes when generating MinGW
Makefiles to avoid gmake interpreting the first `\` as an escape
character.

Fixes: #24061
This commit is contained in:
Ed Hartley authored and Brad King committed 2022-10-18 14:30:57 -04:00
1 parent 53841c6ea2
commit 9777e4c30e
1 file changed
+7
+7
View File
@@ -527,6 +527,13 @@ bool cmOutputConverter::Shell_ArgumentNeedsQuotes(cm::string_view in,
}
}
/* UNC paths in MinGW Makefiles need quotes. */
if ((flags & Shell_Flag_MinGWMake) && (flags & Shell_Flag_Make)) {
if (in.size() > 1 && in[0] == '\\' && in[1] == '\\') {
return true;
}
}
return false;
}