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
2022-10-18 09:20:44 +01:00
committed by Brad King
parent 53841c6ea2
commit 9777e4c30e

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;
}