changeset 31883:b14ca9b6b6d4

Simplify and document MinGW stdin hack.
author reimar
date Mon, 16 Aug 2010 10:45:37 +0000
parents ef30e1505969
children 907539edd483
files stream/stream_file.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_file.c	Mon Aug 16 10:33:33 2010 +0000
+++ b/stream/stream_file.c	Mon Aug 16 10:45:37 2010 +0000
@@ -168,10 +168,11 @@
 
   len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET);
 #ifdef __MINGW32__
-  if(f==0 || len == -1) {
-#else
+  // seeks on stdin incorrectly succeed on MinGW
+  if(f==0)
+    len = -1;
+#endif
   if(len == -1) {
-#endif
     if(mode == STREAM_READ) stream->seek = seek_forward;
     stream->type = STREAMTYPE_STREAM; // Must be move to STREAMTYPE_FILE
     stream->flags |= MP_STREAM_SEEK_FW;