# HG changeset patch # User Daniel Atallah # Date 1267669250 0 # Node ID d4c887b0cb437e335a52f7cc2d10e96f64fc80b2 # Parent f33da955a815b42f58dd9bf446fc89185ca8a75f Make the portable mode launcher try the "normal" mode path. diff -r f33da955a815 -r d4c887b0cb43 pidgin/win32/winpidgin.c --- a/pidgin/win32/winpidgin.c Wed Mar 03 22:08:35 2010 +0000 +++ b/pidgin/win32/winpidgin.c Thu Mar 04 02:20:50 2010 +0000 @@ -97,7 +97,7 @@ return ret; } -static void common_dll_prep(const TCHAR *path) { +static BOOL common_dll_prep(const TCHAR *path) { HMODULE hmod; HKEY hkey; struct _stat stat_buf; @@ -110,7 +110,7 @@ if (_tstat(test_path, &stat_buf) != 0) { printf("Unable to determine GTK+ path. \n" "Assuming GTK+ is in the PATH.\n"); - return; + return FALSE; } @@ -184,6 +184,8 @@ printf("SafeDllSearchMode is set to 0\n"); }/*end else*/ } + + return TRUE; } static void portable_mode_dll_prep(const TCHAR *pidgin_dir) { @@ -224,22 +226,23 @@ _tprintf(_T("%s\n"), path2); _tputenv(path2); - /* set the GTK+ path to be \\path\to\GTK\bin */ - _tcscat(path, _T("\\GTK\\bin")); - - common_dll_prep(path); + if (!dll_prep(pidgin_dir)) { + /* set the GTK+ path to be \\path\to\GTK\bin */ + _tcscat(path, _T("\\GTK\\bin")); + common_dll_prep(path); + } } -static void dll_prep(const TCHAR *pidgin_dir) { - TCHAR gtk_path[MAX_PATH + 1]; - gtk_path[0] = _T('\0'); +static BOOL dll_prep(const TCHAR *pidgin_dir) { + TCHAR path[MAX_PATH + 1]; + path[0] = _T('\0'); if (*pidgin_dir) { - _sntprintf(gtk_path, sizeof(gtk_path) / sizeof(TCHAR), _T("%s\\Gtk\\bin"), pidgin_dir); - gtk_path[sizeof(gtk_path) / sizeof(TCHAR)] = _T('\0'); + _sntprintf(path, sizeof(path) / sizeof(TCHAR), _T("%s\\Gtk\\bin"), pidgin_dir); + path[sizeof(path) / sizeof(TCHAR)] = _T('\0'); } - common_dll_prep(gtk_path); + return common_dll_prep(path); } static TCHAR* winpidgin_lcid_to_posix(LCID lcid) {