Diff
Not logged in

Differences From:

File src/main.c part of check-in [9de6abab2a] - Miscellaneous cosmetic changes by eric on 2008-11-15 14:18:09. [view]

To:

File src/main.c part of check-in [22cb1e1be2] - Here is a better fix for ticket c62fac40af suggested by Kees Nuyt. by drh on 2008-11-20 00:35:23. [view]

@@ -27,8 +27,9 @@
 #include "config.h"
 #include "main.h"
 #include <string.h>
 #include <time.h>
+#include <fcntl.h>
 
 #if INTERFACE
 
 /*
@@ -609,8 +610,14 @@
     zFile = g.argv[1];
   }
   g.httpOut = stdout;
   g.httpIn = stdin;
+#ifdef __MINGW32__
+  /* Set binary mode on windows to avoid undesired translations
+  ** between \n and \r\n. */
+  setmode(_fileno(g.httpOut), _O_BINARY);
+  setmode(_fileno(g.httpIn), _O_BINARY);
+#endif
   g.cgiPanic = 1;
   blob_read_from_file(&config, zFile);
   while( blob_line(&config, &line) ){
     if( !blob_token(&line, &key) ) continue;