gtk+ r22098 - branches/gtk-2-14/gdk-pixbuf



Author: tml
Date: Mon Jan 12 16:22:44 2009
New Revision: 22098
URL: http://svn.gnome.org/viewvc/gtk+?rev=22098&view=rev

Log:
2009-01-12  Tor Lillqvist  <tml iki fi>

	Bug 164002 - query scripts don't work uninstalled on windows

	* queryloaders.c (main): Use the configure-time PIXBUF_LIBDIR if
	the exe is located in a .libs folder, i.e. run in the build
	directory through a libtool wrapper script or wrapper executable,
	or in the source folder itself. Otherwise continue to infer the
	runtime prefix from the exe's location.



Modified:
   branches/gtk-2-14/gdk-pixbuf/ChangeLog
   branches/gtk-2-14/gdk-pixbuf/queryloaders.c

Modified: branches/gtk-2-14/gdk-pixbuf/queryloaders.c
==============================================================================
--- branches/gtk-2-14/gdk-pixbuf/queryloaders.c	(original)
+++ branches/gtk-2-14/gdk-pixbuf/queryloaders.c	Mon Jan 12 16:22:44 2009
@@ -236,14 +236,27 @@
 		slash = strrchr (runtime_prefix, '\\');
 		*slash = '\0';
 		slash = strrchr (runtime_prefix, '\\');
-		if (slash != NULL && g_ascii_strcasecmp (slash + 1, "bin") == 0) {
-			*slash = '\0';
+		/* If running from some weird location, or from the
+		 * build directory (either in the .libs folder where
+		 * libtool places the real executable when using a
+		 * wrapper, or directly from the gdk-pixbuf folder),
+		 * use the compile-time libdir.
+		 */
+		if (slash == NULL ||
+		    g_ascii_strcasecmp (slash + 1, ".libs") == 0 ||
+		    g_ascii_strcasecmp (slash + 1, "gdk-pixbuf") == 0) {
+			libdir = PIXBUF_LIBDIR;
 		}
+		else {
+			if (slash != NULL && g_ascii_strcasecmp (slash + 1, "bin") == 0) {
+				*slash = '\0';
+			}
 		
-		libdir = g_strconcat (runtime_prefix,
-				      "/",
-				      PIXBUF_LIBDIR + strlen (GTK_PREFIX) + 1,
-				      NULL);
+			libdir = g_strconcat (runtime_prefix,
+					      "/",
+					      PIXBUF_LIBDIR + strlen (GTK_PREFIX) + 1,
+					      NULL);
+		}
 	}
 	else {
 		libdir = PIXBUF_LIBDIR;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]