diff --git a/CHANGES b/CHANGES index c6655a97a2827a814ee4930e237ef49087cafdad..4b6b5d12ef17f1615b793bd8787b794efe1b2641 100644 --- a/CHANGES +++ b/CHANGES @@ -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() diff --git a/lib/modules/Process.pmod b/lib/modules/Process.pmod index a7368d7599d2d5e1d1c5346b258ec87783aba2a0..767d5a498c866540b0e93a45677050b93ee10419 100644 --- a/lib/modules/Process.pmod +++ b/lib/modules/Process.pmod @@ -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 )