# 30outstream.patch by Niko Tyni <ntyni@iki.fi>
# DP: Fix SIGSEGV after "|" command. (#236018)
--- a/Gnu.xs
+++ b/Gnu.xs
@@ -3166,6 +3166,12 @@
 	      PerlIO_releaseFILE(outstreamPIO, rl_outstream);
 #endif
 	    rl_outstream = PerlIO_findFILE(stream);
+	    /*
+	     * Debian-specific addition fixing a segfault with "PERLIO=stdio"
+	     * see http://bugs.debian.org/350991
+	     */
+	    if (!rl_outstream)
+	      rl_outstream = stdout;
 	    RETVAL = outstreamPIO = stream;
 #ifdef __CYGWIN__
 	    {
