diff options
Diffstat (limited to 'get_path.c')
-rw-r--r-- | get_path.c | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/get_path.c b/get_path.c index 4a04f9ebb7..ad3c422639 100644 --- a/get_path.c +++ b/get_path.c @@ -40,11 +40,10 @@ #elif defined(__CYGWIN__) #include <windows.h> #include <sys/cygwin.h> -#elif defined(__OS2__) -#define INCL_DOS -#include <os2.h> #endif +#include "osdep/osdep.h" + char *get_path(const char *filename){ char *homedir; char *buff; @@ -160,36 +159,19 @@ char *get_path(const char *filename){ void set_path_env(void) { /*make our codec dirs available for LoadLibraryA()*/ - char tmppath[MAX_PATH*2 + 1]; char win32path[MAX_PATH]; - char realpath[MAX_PATH]; #ifdef __CYGWIN__ - cygwin_conv_to_full_win32_path(WIN32_PATH,win32path); - strcpy(tmppath,win32path); -#ifdef CONFIG_REALCODECS - cygwin_conv_to_full_win32_path(REALCODEC_PATH,realpath); - sprintf(tmppath,"%s;%s",win32path,realpath); -#endif /*CONFIG_REALCODECS*/ + cygwin_conv_to_full_win32_path(BINARY_CODECS_PATH, win32path); #else /*__CYGWIN__*/ /* Expand to absolute path unless it's already absolute */ - if (!strstr(WIN32_PATH,":") && WIN32_PATH[0] != '\\'){ + if (!strstr(BINARY_CODECS_PATH,":") && BINARY_CODECS_PATH[0] != '\\') { GetModuleFileNameA(NULL, win32path, MAX_PATH); - strcpy(strrchr(win32path, '\\') + 1, WIN32_PATH); - } - else strcpy(win32path,WIN32_PATH); - strcpy(tmppath,win32path); -#ifdef CONFIG_REALCODECS - /* Expand to absolute path unless it's already absolute */ - if (!strstr(REALCODEC_PATH,":") && REALCODEC_PATH[0] != '\\'){ - GetModuleFileNameA(NULL, realpath, MAX_PATH); - strcpy(strrchr(realpath, '\\') + 1, REALCODEC_PATH); + strcpy(strrchr(win32path, '\\') + 1, BINARY_CODECS_PATH); } - else strcpy(realpath,REALCODEC_PATH); - sprintf(tmppath,"%s;%s",win32path,realpath); -#endif /*CONFIG_REALCODECS*/ + else strcpy(win32path, BINARY_CODECS_PATH); #endif /*__CYGWIN__*/ - mp_msg(MSGT_WIN32, MSGL_V,"Setting PATH to %s\n",tmppath); - if (!SetEnvironmentVariableA("PATH", tmppath)) + mp_msg(MSGT_WIN32, MSGL_V, "Setting PATH to %s\n", win32path); + if (!SetEnvironmentVariableA("PATH", win32path)) mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!"); } #endif /* (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) */ |