X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Fsubprocs.c;h=19697241d947073be525043fb592cd77adbfb613;hb=d5186197bc394e10a4402f7f6d23fbb14103bc50;hp=2a8f163ec6522da4bde3bb3e5e72d25ae5c611f0;hpb=6f5482d73adb0165c0130bb47d852644ab0c4869;p=xscreensaver diff --git a/driver/subprocs.c b/driver/subprocs.c index 2a8f163e..19697241 100644 --- a/driver/subprocs.c +++ b/driver/subprocs.c @@ -1,5 +1,5 @@ /* subprocs.c --- choosing, spawning, and killing screenhacks. - * xscreensaver, Copyright (c) 1991-2012 Jamie Zawinski + * xscreensaver, Copyright (c) 1991-2014 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -1101,7 +1101,9 @@ hack_environment (saver_info *si) if (def_path && *def_path) { const char *opath = getenv("PATH"); - char *npath = (char *) malloc(strlen(def_path) + strlen(opath) + 20); + char *npath; + if (! opath) opath = "/bin:/usr/bin"; /* WTF */ + npath = (char *) malloc(strlen(def_path) + strlen(opath) + 20); strcpy (npath, "PATH="); strcat (npath, def_path); strcat (npath, ":");