From e03c2c0dbde0000f4816967bb9609e0571d55512 Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Thu, 31 Jul 2003 21:46:37 +0000 Subject: [PATCH] * src/misc/win32_specific.c: change the mode of stdin to _O_BINARY so we can use stdin to read files (thanks to Steve Li). * modules/control/http.c: allow directories of the form "x:\" on win32. --- modules/control/http.c | 10 +++++++--- src/misc/win32_specific.c | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/control/http.c b/modules/control/http.c index ba3ba3794c..139b356e02 100644 --- a/modules/control/http.c +++ b/modules/control/http.c @@ -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 * Laurent Aimar @@ -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'; } diff --git a/src/misc/win32_specific.c b/src/misc/win32_specific.c index b26200dca8..b49ec14006 100644 --- a/src/misc/win32_specific.c +++ b/src/misc/win32_specific.c @@ -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 * Gildas Bazin @@ -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 ) ) -- 2.39.2