Merge pull request #474 from Brikaa/stdin-newline

Piston Nix: Add trailing newline in stdin if it doesn't exist
This commit is contained in:
Thomas Hobson 2022-05-10 23:16:25 +12:00 committed by GitHub
commit 1fa110c1cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;