From 4c81497d907261580d3ff4685c4a542ecb5209a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 21 Nov 2005 10:32:44 +0000 Subject: *BUGFIX* Fixed funny bug under Windows due to stdin plugin: each 0x0D was eaten. CVS patchset: 7809 CVS date: 2005/11/21 10:32:44 --- src/input/input_stdin_fifo.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c index 87d38a6e1..a3fa8d289 100644 --- a/src/input/input_stdin_fifo.c +++ b/src/input/input_stdin_fifo.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: input_stdin_fifo.c,v 1.63 2005/10/14 21:02:16 miguelfreitas Exp $ + * $Id: input_stdin_fifo.c,v 1.64 2005/11/21 10:32:44 valtri Exp $ */ #ifdef HAVE_CONFIG_H @@ -27,8 +27,8 @@ #include #include #include -#include #include +#include #include #include @@ -44,6 +44,11 @@ #include "net_buf_ctrl.h" #define BUFSIZE 1024 +#if defined(WIN32) || defined(__CYGWIN__) +# define FILE_FLAGS (O_RDONLY | O_BINARY) +#else +# define FILE_FLAGS O_RDONLY +#endif typedef struct { input_plugin_t input_plugin; @@ -241,7 +246,7 @@ static int stdin_plugin_open (input_plugin_t *this_gen ) { char *filename; filename = (char *) &this->mrl[5]; - this->fh = open (filename, O_RDONLY); + this->fh = open (filename, FILE_FLAGS); lprintf("filename '%s'\n", filename); @@ -250,6 +255,9 @@ static int stdin_plugin_open (input_plugin_t *this_gen ) { return 0; } } +#ifdef WIN32 + else setmode(this->fh, FILE_FLAGS); +#endif /* -- cgit v1.2.3