Guard against _glib_get_installation_directory() returning NULL. In that
authorTor Lillqvist <tml@novell.com>
Sun, 24 Feb 2008 21:31:44 +0000 (21:31 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Sun, 24 Feb 2008 21:31:44 +0000 (21:31 +0000)
2008-02-24  Tor Lillqvist  <tml@novell.com>

* glib/gspawn-win32.c: Guard against
_glib_get_installation_directory() returning NULL. In that
case, just use the name of the helper process executable
without path.

svn path=/trunk/; revision=6576

glib/gspawn-win32.c

index dded80718aaa5d8cc4c4aeeb8c854f43b73ef3bc..99f391a359493d2c531ca69505a383d740a89040 100644 (file)
@@ -592,8 +592,13 @@ do_spawn_with_pipes (gint                 *exit_status,
     helper_process = HELPER_PROCESS ".exe";
   
   glib_top = _glib_get_installation_directory ();
-  helper_process = g_build_filename (glib_top, "bin", helper_process, NULL);
-  g_free (glib_top);
+  if (glib_top != NULL)
+    {
+      helper_process = g_build_filename (glib_top, "bin", helper_process, NULL);
+      g_free (glib_top);
+    }
+  else
+    helper_process = g_strdup (helper_process);
 
   new_argv[0] = helper_process;