]> git.sesse.net Git - vlc/commitdiff
* src/misc/win32_specific.c: change the mode of stdin to _O_BINARY so we can use...
authorGildas Bazin <gbazin@videolan.org>
Thu, 31 Jul 2003 21:46:37 +0000 (21:46 +0000)
committerGildas Bazin <gbazin@videolan.org>
Thu, 31 Jul 2003 21:46:37 +0000 (21:46 +0000)
* modules/control/http.c: allow directories of the form "x:\" on win32.

modules/control/http.c
src/misc/win32_specific.c

index ba3ba3794cec39079c844857db02ef11e1461a03..139b356e02cff860bb5433dd0c82382f88fe0e12 100644 (file)
@@ -2,7 +2,7 @@
  * http.c :  http mini-server ;)
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: http.c,v 1.19 2003/07/30 21:09:06 gbazin Exp $
+ * $Id: http.c,v 1.20 2003/07/31 21:46:37 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *          Laurent Aimar <fenrir@via.ecp.fr>
@@ -997,8 +997,12 @@ static mvar_t *mvar_FileSetNew( char *name, char *psz_dir )
     sep = '/';
 #endif
 
-    /* remove trailling separoator */
-    while( strlen( psz_dir ) > 1 && psz_dir[strlen( psz_dir ) -1 ] == sep )
+    /* remove trailling separator */
+    while( strlen( psz_dir ) > 1 &&
+#if defined( WIN32 )
+           !( strlen(psz_dir)==3 && psz_dir[1]==':' && psz_dir[2]==sep ) &&
+#endif
+           psz_dir[strlen( psz_dir ) -1 ] == sep )
     {
         psz_dir[strlen( psz_dir ) -1 ]  ='\0';
     }
index b26200dca8c2975c06efc1f6797881fff5e6fcb3..b49ec1400609ad4bc56f1b4c8611fc8be08a7396 100644 (file)
@@ -2,7 +2,7 @@
  * win32_specific.c: Win32 specific features
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: win32_specific.c,v 1.23 2003/07/18 20:52:11 gbazin Exp $
+ * $Id: win32_specific.c,v 1.24 2003/07/31 21:46:37 gbazin Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -64,6 +64,7 @@ void system_Init( vlc_t *p_this, int *pi_argc, char *ppsz_argv[] )
 
     /* Set the default file-translation mode */
     _fmode = _O_BINARY;
+    _setmode( _fileno( stdin ), _O_BINARY ); /* Needed for pipes */
 
     /* WinSock Library Init. */
     if( !WSAStartup( MAKEWORD( 2, 0 ), &Data ) )