From 7796c039cb2a6e54c1e646426e734c1e4b916544 Mon Sep 17 00:00:00 2001 From: Alexis Campailla Date: Fri, 2 Jan 2015 17:36:47 -0500 Subject: [PATCH] Fix redis-cli pipe mode Pipe mode was broken due to CRT's translation of CRLF sequences. --- src/redis-cli.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/redis-cli.c b/src/redis-cli.c index 88565d43..1aad2c15 100644 --- a/src/redis-cli.c +++ b/src/redis-cli.c @@ -1246,6 +1246,11 @@ static void pipeMode(void) { char magic[20]; /* Special reply we recognize. */ time_t last_read_time = time(NULL); +#ifdef _WIN32 + /* Prevent translation or CRLF sequences. */ + setmode(STDIN_FILENO,_O_BINARY); +#endif + srand((unsigned int)time(NULL)); /* Use non blocking I/O. */ -- GitLab