Skip to content
Snippets Groups Projects
Commit be044a2d authored by Tobias S. Josefowitz's avatar Tobias S. Josefowitz
Browse files

Process.run: Accept empty string in modifiers as stdin

Restores behaviour as of 7.8.

Fixes [LysLysKOM 23099651]. Thanks to Per Cederqvist for the report.
parent 5d3ed9eb
Branches
Tags
No related merge requests found
......@@ -70,6 +70,11 @@ o Compiler
- Fixed some corner cases where file names where missing from
backtraces.
o Process.run
- Don't error if stdin modifier is supplied as the empty string.
[LysLysKOM 23099651]
o Protocols.HTTP.Session
- Fix race-condition when multiple threads call give_me_connection()
......
......@@ -611,15 +611,20 @@ mapping run(string|array(string) cmd, void|mapping modifiers)
});
if (mystdin) {
Shuffler.Shuffler sfr = Shuffler.Shuffler();
sfr->set_backend (backend);
Shuffler.Shuffle sf = sfr->shuffle( mystdin );
sf->add_source(stdin_str);
sf->set_done_callback (lambda () {
catch { mystdin->close(); };
mystdin = 0;
});
sf->start();
if (stdin_str != "") {
Shuffler.Shuffler sfr = Shuffler.Shuffler();
sfr->set_backend (backend);
Shuffler.Shuffle sf = sfr->shuffle( mystdin );
sf->add_source(stdin_str);
sf->set_done_callback (lambda () {
catch { mystdin->close(); };
mystdin = 0;
});
sf->start();
} else {
catch { mystdin->close(); };
mystdin = 0;
}
}
while( mystdout || mystderr || mystdin )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment