From http://www.jwz.org/xscreensaver/xscreensaver-5.27.tar.gz
[xscreensaver] / driver / subprocs.c
index fb621cdef69fd39b243a27f02a4276a3eb4b3e8c..65b0079abd86941009eb0cc74662ecaa441838cd 100644 (file)
@@ -1,5 +1,5 @@
 /* subprocs.c --- choosing, spawning, and killing screenhacks.
- * xscreensaver, Copyright (c) 1991-2008 Jamie Zawinski <jwz@jwz.org>
+ * xscreensaver, Copyright (c) 1991-2014 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -484,6 +484,7 @@ static RETSIGTYPE
 sigchld_handler (int sig)
 {
   saver_info *si = global_si_kludge;   /* I hate C so much... */
+  in_signal_handler_p++;
 
   if (si->prefs.debug_p)
     {
@@ -510,6 +511,7 @@ sigchld_handler (int sig)
     }
 
   init_sigchld();
+  in_signal_handler_p--;
 }
 #endif /* SIGCHLD */
 
@@ -1099,6 +1101,7 @@ hack_environment (saver_info *si)
   if (def_path && *def_path)
     {
       const char *opath = getenv("PATH");
+      if (! opath) opath = "/bin:/usr/bin";  /* WTF */
       char *npath = (char *) malloc(strlen(def_path) + strlen(opath) + 20);
       strcpy (npath, "PATH=");
       strcat (npath, def_path);