pidgin: 1036d6fc: This should have been part of the previo...

datallah at pidgin.im datallah at pidgin.im
Wed Jul 30 17:22:35 EDT 2008


-----------------------------------------------------------------
Revision: 1036d6fc1c09bf3b42c737dab42d188245f16b17
Ancestor: 3b1db8cf7e4f877fec5c2f491ff29a079e8034e9
Author: datallah at pidgin.im
Date: 2008-07-30T21:09:51
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/1036d6fc1c09bf3b42c737dab42d188245f16b17

Modified files:
        libpurple/protocols/jabber/Makefile.mingw
        pidgin/win32/winpidgin.c

ChangeLog: 

This should have been part of the previous commit related to no longer
installing our own MIT Kerberos libraries.
This also tries to fix the PATH at runtime if MIT Kerberos is installed.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/Makefile.mingw	f0ba792560dee01a48fc6252c5fb4b1fd8e71689
+++ libpurple/protocols/jabber/Makefile.mingw	f3643645466cd2453f5c5ed6294505921b2c264d
@@ -88,10 +88,6 @@ CYRUS_SASL_DLLS = \
 LIB_PATHS += -L$(CYRUS_SASL_TOP)/bin
 LIBS += -llibsasl
 CYRUS_SASL_DLLS = \
-			$(CYRUS_SASL_TOP)/bin/comerr32.dll \
-			$(CYRUS_SASL_TOP)/bin/gssapi32.dll \
-			$(CYRUS_SASL_TOP)/bin/k5sprt32.dll \
-			$(CYRUS_SASL_TOP)/bin/krb5_32.dll \
 			$(CYRUS_SASL_TOP)/bin/libsasl.dll
 
 CYRUS_SASL_PLUGINS = \
============================================================
--- pidgin/win32/winpidgin.c	863f53e4c2109e9216f366ffa62c4b1ab4faa38b
+++ pidgin/win32/winpidgin.c	68b1b91d8f6b06e20938036736fdd5c292be3eb3
@@ -441,45 +441,77 @@ static void winpidgin_set_locale() {
 	_putenv(envstr);
 }
 
-static void winpidgin_add_perl_to_path() {
+
+static void winpidgin_add_stuff_to_path() {
 	char perl_path[MAX_PATH + 1];
-	DWORD plen = sizeof(perl_path);
+	char *ppath = NULL;
+	char mit_kerberos_path[MAX_PATH + 1];
+	char *mpath = NULL;
+	DWORD plen;
 
 	printf("%s", "Looking for Perl... ");
 
+	plen = sizeof(perl_path);
 	if (read_reg_string(HKEY_LOCAL_MACHINE, "SOFTWARE\\Perl", "",
 			    (LPBYTE) &perl_path, &plen)) {
-		const char *path = getenv("PATH");
-		/* Enough to add "PATH=" + ";"  + perl_path + "\\bin" + \0 */
-
 		/* We *could* check for perl510.dll, but it seems unnecessary. */
-
 		printf("found in '%s'.\n", perl_path);
 
-		if (perl_path[strlen(perl_path) - 1] != '\\') {
+		if (perl_path[strlen(perl_path) - 1] != '\\')
 			strcat(perl_path, "\\");
-		}
 		strcat(perl_path, "bin");
 
-		if (path == NULL || !strstr(path, perl_path)) {
-			int newlen = (path ? strlen(path) : 0) + strlen(perl_path) + 10;
-			char *newpath = malloc(newlen);
+		ppath = perl_path;
+	} else
+		printf("%s", "not found.\n");
+
+	printf("%s", "Looking for MIT Kerberos... ");
+
+	plen = sizeof(mit_kerberos_path);
+	if (read_reg_string(HKEY_LOCAL_MACHINE, "SOFTWARE\\MIT\\Kerberos", "InstallDir",
+			    (LPBYTE) &mit_kerberos_path, &plen)) {
+		/* We *could* check for gssapi32.dll */
+		printf("found in '%s'.\n", mit_kerberos_path);
+
+		if (mit_kerberos_path[strlen(mit_kerberos_path) - 1] != '\\')
+			strcat(mit_kerberos_path, "\\");
+		strcat(mit_kerberos_path, "bin");
+
+		mpath = mit_kerberos_path;
+	} else
+		printf("%s", "not found.\n");
+
+	if (ppath != NULL || mpath != NULL) {
+		const char *path = getenv("PATH");
+		BOOL add_ppath = ppath != NULL && (path == NULL || !strstr(path, ppath));
+		BOOL add_mpath = mpath != NULL && (path == NULL || !strstr(path, mpath));
+		char *newpath;
+		int newlen;
+
+		if (add_ppath || add_mpath) {
+			/* Enough to add "PATH=" + path + ";"  + ppath + ";" + mpath + \0 */
+			newlen = 6 + (path ? strlen(path) + 1 : 0);
+			if (add_ppath)
+				newlen += strlen(ppath) + 1;
+			if (add_mpath)
+				newlen += strlen(mpath) + 1;
+			newpath = malloc(newlen);
 			*newpath = '\0';
 
-			_snprintf(newpath, newlen, "PATH=%s%s%s",
+			_snprintf(newpath, newlen, "PATH=%s%s%s%s%s%s",
 				  path ? path : "",
 				  path ? ";" : "",
-				  perl_path);
+				  add_ppath ? ppath : "",
+				  add_ppath ? ";" : "",
+				  add_mpath ? mpath : "",
+				  add_mpath ? ";" : "");
 
-			printf("Adding Perl to PATH: %s\n", newpath);
+			printf("New PATH: %s\n", newpath);
 
 			_putenv(newpath);
 			free(newpath);
-		} else
-			printf("%s\n", "Perl already in PATH.");
-	} else
-		printf("%s", "not found.\n");
-
+		}
+	}
 }
 
 #define PIDGIN_WM_FOCUS_REQUEST (WM_APP + 13)
@@ -672,7 +704,7 @@ WinMain (struct HINSTANCE__ *hInstance, 
 
 	winpidgin_set_locale();
 
-	winpidgin_add_perl_to_path();
+	winpidgin_add_stuff_to_path();
 
 	/* If help, version or multiple flag used, do not check Mutex */
 	if (!strstr(lpszCmdLine, "-h") && !strstr(lpszCmdLine, "-v"))


More information about the Commits mailing list