diff --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/glib/glib/gspawn-win32.c my-gtk/glib/glib/gspawn-win32.c
--- from-cvs/glib/glib/gspawn-win32.c	Fri Oct 17 11:44:48 2003
+++ my-gtk/glib/glib/gspawn-win32.c	Sat Feb 21 16:38:42 2004
@@ -228,8 +228,66 @@
                gint                 *child_handle,
                GError              **error)
 {
+  char executable[MAX_PATH];
+  gint pid;
+
   g_return_val_if_fail (argv != NULL, FALSE);
   
+  if (child_setup)
+    {
+      (* child_setup) (user_data);
+    }
+
+  /* first try: simply execute */
+  pid = _spawnve (_P_NOWAIT, argv[0], argv, envp);
+  if (-1 == pid)
+    {
+      if (32 <= (int)FindExecutable (argv[0], working_directory, executable))
+        {
+          /* e.g. needed to execute Gimp Python plug-ins, which have the
+           * executable flag set on *nix. There is no such on win32. */
+#define _MAX_CMD_LEN 1024
+          /* stuff parameters into one cmndline */
+          char cmdline[_MAX_CMD_LEN];
+          int i, len = 0;
+
+          cmdline[0] = 0;
+          for (i = 0; argv[i] != NULL; i++)
+            {
+               len += strlen(argv[i]) + 1;
+               if (len >= _MAX_CMD_LEN)
+                 {
+                    g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED,
+                                 _("Command line length exceeds internal limit."));
+                   return FALSE;
+                 }
+               strcat (cmdline, argv[i]);
+               strcat (cmdline, " ");
+            }
+          /* remove last blank */
+	  if (len > 0)
+            cmdline[len - 1] = 0;
+
+          pid = _spawnlp (_P_NOWAIT, executable, "-c", cmdline, NULL);
+          if (-1 == pid)
+            {
+              g_set_error (error, G_SPAWN_ERROR, G_SPAWN_ERROR_FAILED,
+                           _("Found executable '%s' but failed to execute."),
+                           executable);
+              return FALSE;
+            }
+#undef _MAX_CMD_LEN
+        }
+    }
+
+  if ((G_SPAWN_DO_NOT_REAP_CHILD & flags) && (child_handle))
+    *child_handle = pid;
+  else
+    CloseHandle ((HANDLE)pid);
+
+  if (-1 != pid)
+    return TRUE;
+
   return g_spawn_async_with_pipes (working_directory,
                                    argv, envp,
                                    flags,
