File popen.c:line 120
<pre>
  fd = _open_osfhandle(hStdoutWr, 0);
</pre>
should be
<pre>
  fd = _open_osfhandle(hStdinWr, 0);
</pre>
I have tested it, it worked well.