From 316e05b877ac8b58afebaae87ada374b73d20f47 Mon Sep 17 00:00:00 2001 From: komh Date: Fri, 19 Feb 2010 09:14:01 +0000 Subject: [PATCH] Replace platform preprocessor check by HAVE_DOS_PATHS. This is both more elegant and more portable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30650 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmenu/menu_filesel.c | 8 ++++---- stream/stream_file.c | 2 +- subreader.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libmenu/menu_filesel.c b/libmenu/menu_filesel.c index 1321702945..e6978d7fc2 100644 --- a/libmenu/menu_filesel.c +++ b/libmenu/menu_filesel.c @@ -147,14 +147,14 @@ static int mylstat(char *dir, char *file,struct stat* st) { char *slash; l -= 3; strcpy(s, dir); -#if defined(__MINGW32__) || defined(__CYGWIN__) +#if HAVE_DOS_PATHS if (s[l] == '/' || s[l] == '\\') #else if (s[l] == '/') #endif s[l] = '\0'; slash = strrchr(s, '/'); -#if defined(__MINGW32__) || defined(__CYGWIN__) +#if HAVE_DOS_PATHS if (!slash) slash = strrchr(s,'\\'); #endif @@ -356,7 +356,7 @@ static void read_cmd(menu_t* menu,int cmd) { if(l <= 1) break; mpriv->dir[l-1] = '\0'; slash = strrchr(mpriv->dir,'/'); -#if defined(__MINGW32__) || defined(__CYGWIN__) +#if HAVE_DOS_PATHS if (!slash) slash = strrchr(mpriv->dir,'\\'); #endif @@ -456,7 +456,7 @@ static int open_fs(menu_t* menu, char* args) { char *slash = NULL; if (filename && !strstr(filename, "://") && (path=realpath(filename, b))) { slash = strrchr(path, '/'); -#if defined(__MINGW32__) || defined(__CYGWIN__) +#if HAVE_DOS_PATHS // FIXME: Do we need and can convert all '\\' in path to '/' on win32? if (!slash) slash = strrchr(path, '\\'); diff --git a/stream/stream_file.c b/stream/stream_file.c index 149660857b..dceea84db0 100644 --- a/stream/stream_file.c +++ b/stream/stream_file.c @@ -130,7 +130,7 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) { return STREAM_ERROR; } -#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__OS2__) +#if HAVE_DOS_PATHS // extract '/' from '/x:/path' if( filename[ 0 ] == '/' && filename[ 1 ] && filename[ 2 ] == ':' ) filename++; diff --git a/subreader.c b/subreader.c index c471e75e53..ddbd2839df 100644 --- a/subreader.c +++ b/subreader.c @@ -1856,7 +1856,7 @@ char** sub_filenames(const char* path, char *fname) subcnt = 0; tmp = strrchr(fname,'/'); -#if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__OS2__) +#if HAVE_DOS_PATHS if(!tmp)tmp = strrchr(fname,'\\'); if(!tmp)tmp = strrchr(fname,':'); #endif