diff -ruN ../gtk+-2.22.0.orig/gtk/gtkmain.c ./gtk/gtkmain.c
--- ../gtk+-2.22.0.orig/gtk/gtkmain.c	2010-09-22 20:00:37.000000000 -0700
+++ ./gtk/gtkmain.c	2010-11-05 23:36:23.347664003 -0700
@@ -98,8 +98,8 @@
   if (gtk_libdir == NULL)
     {
       gchar *root = g_win32_get_package_installation_directory_of_module (gtk_dll);
-      gchar *slash = strrchr (root, '\\');
-      if (g_ascii_strcasecmp (slash + 1, ".libs") == 0)
+      gchar *slash = root ? strrchr (root, '\\') : NULL;
+      if (slash && g_ascii_strcasecmp (slash + 1, ".libs") == 0)
 	gtk_libdir = GTK_LIBDIR;
       else
 	gtk_libdir = g_build_filename (root, "lib", NULL);
