Merge pull request #20805 from xdBronch/lang-flag

handle -x language flag without spaces
This commit is contained in:
Alex Rønne Petersen 2024-10-03 03:58:16 +02:00 committed by GitHub
commit f99097e68f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1703,8 +1703,11 @@ fn buildOutputType(
try cc_argv.append(arena, arg);
} else if (mem.startsWith(u8, arg, "-I")) {
try cssan.addIncludePath(arena, &cc_argv, .I, arg, arg[2..], true);
} else if (mem.eql(u8, arg, "-x")) {
const lang = args_iter.nextOrFatal();
} else if (mem.startsWith(u8, arg, "-x")) {
const lang = if (arg.len == "-x".len)
args_iter.nextOrFatal()
else
arg["-x".len..];
if (mem.eql(u8, lang, "none")) {
file_ext = null;
} else if (Compilation.LangToExt.get(lang)) |got_ext| {