| 108 test_path[sizeof(test_path) / sizeof(TCHAR) - 1] = _T('\0'); |
108 test_path[sizeof(test_path) / sizeof(TCHAR) - 1] = _T('\0'); |
| 109 |
109 |
| 110 if (_tstat(test_path, &stat_buf) != 0) { |
110 if (_tstat(test_path, &stat_buf) != 0) { |
| 111 printf("Unable to determine GTK+ path. \n" |
111 printf("Unable to determine GTK+ path. \n" |
| 112 "Assuming GTK+ is in the PATH.\n"); |
112 "Assuming GTK+ is in the PATH.\n"); |
| 113 return; |
113 return FALSE; |
| 114 } |
114 } |
| 115 |
115 |
| 116 |
116 |
| 117 _tprintf(_T("GTK+ path found: %s\n"), path); |
117 _tprintf(_T("GTK+ path found: %s\n"), path); |
| 118 |
118 |
| 182 (UINT) GetLastError()); |
182 (UINT) GetLastError()); |
| 183 } else |
183 } else |
| 184 printf("SafeDllSearchMode is set to 0\n"); |
184 printf("SafeDllSearchMode is set to 0\n"); |
| 185 }/*end else*/ |
185 }/*end else*/ |
| 186 } |
186 } |
| |
187 |
| |
188 return TRUE; |
| 187 } |
189 } |
| 188 |
190 |
| 189 static void portable_mode_dll_prep(const TCHAR *pidgin_dir) { |
191 static void portable_mode_dll_prep(const TCHAR *pidgin_dir) { |
| 190 /* need to be able to fit MAX_PATH + "PIDGIN_ASPELL_DIR=\\Aspell\\bin" in path2 */ |
192 /* need to be able to fit MAX_PATH + "PIDGIN_ASPELL_DIR=\\Aspell\\bin" in path2 */ |
| 191 TCHAR path[MAX_PATH + 1]; |
193 TCHAR path[MAX_PATH + 1]; |
| 222 |
224 |
| 223 _sntprintf(path2, sizeof(path2) / sizeof(TCHAR), _T("PIDGIN_ASPELL_DIR=%s\\Aspell\\bin"), path); |
225 _sntprintf(path2, sizeof(path2) / sizeof(TCHAR), _T("PIDGIN_ASPELL_DIR=%s\\Aspell\\bin"), path); |
| 224 _tprintf(_T("%s\n"), path2); |
226 _tprintf(_T("%s\n"), path2); |
| 225 _tputenv(path2); |
227 _tputenv(path2); |
| 226 |
228 |
| 227 /* set the GTK+ path to be \\path\to\GTK\bin */ |
229 if (!dll_prep(pidgin_dir)) { |
| 228 _tcscat(path, _T("\\GTK\\bin")); |
230 /* set the GTK+ path to be \\path\to\GTK\bin */ |
| 229 |
231 _tcscat(path, _T("\\GTK\\bin")); |
| 230 common_dll_prep(path); |
232 common_dll_prep(path); |
| 231 } |
233 } |
| 232 |
234 } |
| 233 static void dll_prep(const TCHAR *pidgin_dir) { |
235 |
| 234 TCHAR gtk_path[MAX_PATH + 1]; |
236 static BOOL dll_prep(const TCHAR *pidgin_dir) { |
| 235 gtk_path[0] = _T('\0'); |
237 TCHAR path[MAX_PATH + 1]; |
| |
238 path[0] = _T('\0'); |
| 236 |
239 |
| 237 if (*pidgin_dir) { |
240 if (*pidgin_dir) { |
| 238 _sntprintf(gtk_path, sizeof(gtk_path) / sizeof(TCHAR), _T("%s\\Gtk\\bin"), pidgin_dir); |
241 _sntprintf(path, sizeof(path) / sizeof(TCHAR), _T("%s\\Gtk\\bin"), pidgin_dir); |
| 239 gtk_path[sizeof(gtk_path) / sizeof(TCHAR)] = _T('\0'); |
242 path[sizeof(path) / sizeof(TCHAR)] = _T('\0'); |
| 240 } |
243 } |
| 241 |
244 |
| 242 common_dll_prep(gtk_path); |
245 return common_dll_prep(path); |
| 243 } |
246 } |
| 244 |
247 |
| 245 static TCHAR* winpidgin_lcid_to_posix(LCID lcid) { |
248 static TCHAR* winpidgin_lcid_to_posix(LCID lcid) { |
| 246 TCHAR *posix = NULL; |
249 TCHAR *posix = NULL; |
| 247 int lang_id = PRIMARYLANGID(lcid); |
250 int lang_id = PRIMARYLANGID(lcid); |