Add trailing newline in stdin if it doesn't exist

This commit is contained in:
Omar Brikaa 2022-05-02 15:33:30 +02:00
parent 61a833ca3c
commit 8bb72837b9
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,10 @@ class Job {
this.args = args; this.args = args;
this.stdin = stdin; this.stdin = stdin;
// Add a trailing newline if it doesn't exist
if (this.stdin.slice(-1) !== '\n') {
this.stdin += '\n';
}
this.timeouts = timeouts; this.timeouts = timeouts;
this.memory_limits = memory_limits; this.memory_limits = memory_limits;