Mercurial > mplayer.hg
comparison get_path.c @ 30853:88e57c2b3f58
Get rid of pointless tmppath variable in set_path_env().
author | diego |
---|---|
date | Sun, 14 Mar 2010 23:42:03 +0000 |
parents | 72ae3dd3aa6e |
children | e907ff9e7e77 |
comparison
equal
deleted
inserted
replaced
30852:c57c53fcda6b | 30853:88e57c2b3f58 |
---|---|
157 | 157 |
158 #if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) | 158 #if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) |
159 void set_path_env(void) | 159 void set_path_env(void) |
160 { | 160 { |
161 /*make our codec dirs available for LoadLibraryA()*/ | 161 /*make our codec dirs available for LoadLibraryA()*/ |
162 char tmppath[MAX_PATH*2 + 1]; | |
163 char win32path[MAX_PATH]; | 162 char win32path[MAX_PATH]; |
164 #ifdef __CYGWIN__ | 163 #ifdef __CYGWIN__ |
165 cygwin_conv_to_full_win32_path(BINARY_CODECS_PATH, win32path); | 164 cygwin_conv_to_full_win32_path(BINARY_CODECS_PATH, win32path); |
166 strcpy(tmppath,win32path); | |
167 #else /*__CYGWIN__*/ | 165 #else /*__CYGWIN__*/ |
168 /* Expand to absolute path unless it's already absolute */ | 166 /* Expand to absolute path unless it's already absolute */ |
169 if (!strstr(BINARY_CODECS_PATH,":") && BINARY_CODECS_PATH[0] != '\\') { | 167 if (!strstr(BINARY_CODECS_PATH,":") && BINARY_CODECS_PATH[0] != '\\') { |
170 GetModuleFileNameA(NULL, win32path, MAX_PATH); | 168 GetModuleFileNameA(NULL, win32path, MAX_PATH); |
171 strcpy(strrchr(win32path, '\\') + 1, BINARY_CODECS_PATH); | 169 strcpy(strrchr(win32path, '\\') + 1, BINARY_CODECS_PATH); |
172 } | 170 } |
173 else strcpy(win32path, BINARY_CODECS_PATH); | 171 else strcpy(win32path, BINARY_CODECS_PATH); |
174 strcpy(tmppath,win32path); | |
175 #endif /*__CYGWIN__*/ | 172 #endif /*__CYGWIN__*/ |
176 mp_msg(MSGT_WIN32, MSGL_V,"Setting PATH to %s\n",tmppath); | 173 mp_msg(MSGT_WIN32, MSGL_V, "Setting PATH to %s\n", win32path); |
177 if (!SetEnvironmentVariableA("PATH", tmppath)) | 174 if (!SetEnvironmentVariableA("PATH", win32path)) |
178 mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!"); | 175 mp_msg(MSGT_WIN32, MSGL_WARN, "Cannot set PATH!"); |
179 } | 176 } |
180 #endif /* (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) */ | 177 #endif /* (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL) */ |