pidgin: 50bfc1e5: Make the portable mode launcher try the ...

datallah at pidgin.im datallah at pidgin.im
Wed Mar 3 21:46:04 EST 2010


-----------------------------------------------------------------
Revision: 50bfc1e52f03a370171dc1957fd813da54062657
Ancestor: ce9316b2f6f374cb09b30126eef41bcf32e87df9
Author: datallah at pidgin.im
Date: 2010-03-04T02:20:50
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/50bfc1e52f03a370171dc1957fd813da54062657

Modified files:
        pidgin/win32/winpidgin.c

ChangeLog: 

Make the portable mode launcher try the "normal" mode path.

-------------- next part --------------
============================================================
--- pidgin/win32/winpidgin.c	2dc880009283250c63445c1f5035c711c4fcb5ff
+++ pidgin/win32/winpidgin.c	f1d18ea326055cf7b09ae47e741c34a0c58f2c02
@@ -97,7 +97,7 @@ static BOOL read_reg_string(HKEY key, TC
 	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 @@ static void common_dll_prep(const TCHAR 
 	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 @@ static void common_dll_prep(const TCHAR 
 				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 @@ static void portable_mode_dll_prep(const
 	_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) {


More information about the Commits mailing list