Skip to content

Instantly share code, notes, and snippets.

@cmb69

cmb69/.diff Secret

Created September 5, 2019 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmb69/697190ceb936f89d271eab3b77bb79a8 to your computer and use it in GitHub Desktop.
Save cmb69/697190ceb936f89d271eab3b77bb79a8 to your computer and use it in GitHub Desktop.
PR #4684
main/streams/plain_wrapper.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index bc24423aab..61b19e48ad 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -251,7 +251,9 @@ static void detect_is_pipe(php_stdio_stream_data *self) {
zend_uintptr_t handle = _get_osfhandle(self->fd);
if (handle != (zend_uintptr_t)INVALID_HANDLE_VALUE) {
- self->is_pipe = GetFileType((HANDLE)handle) == FILE_TYPE_PIPE;
+ DWORD file_type = GetFileType((HANDLE)handle);
+
+ self->is_pipe = file_type == FILE_TYPE_PIPE || file_type == FILE_TYPE_CHAR;
}
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment