judge: compilerText: allow multiple files

This commit is contained in:
undefined committed 2025-06-08 19:46:51 +08:00
1 parent 1586852f1e
commit a361e420aa
1 file changed
+2 -5
+2 -5
View File
@@ -27,11 +27,8 @@ export namespace Lock {
} }
} }
export function compilerText(stdout: string, stderr: string) { export function compilerText(...messages: string[]) {
const ret = []; return messages.filter((i) => !EMPTY_STR.test(i)).map((i) => i.substring(0, 1024 * 1024)).join('\n');
if (!EMPTY_STR.test(stdout)) ret.push(stdout.substring(0, 1024 * 1024));
if (!EMPTY_STR.test(stderr)) ret.push(stderr.substring(0, 1024 * 1024));
return ret.join('\n');
} }
function restrictFile(p: string) { function restrictFile(p: string) {