weston-launch: Only pass non-NULL value into setenv()

getenv() can return NULL is the key is not set, passing NULL into
setenv() is an error
dev
Rob Bradford 11 years ago committed by Kristian Høgsberg
parent 14c9892069
commit 7ac9f73c7d
  1. 3
      src/weston-launch.c

@ -515,7 +515,8 @@ setup_session(struct weston_launch *wl)
term = getenv("TERM");
clearenv();
setenv("TERM", term, 1);
if (term)
setenv("TERM", term, 1);
setenv("USER", wl->pw->pw_name, 1);
setenv("LOGNAME", wl->pw->pw_name, 1);
setenv("HOME", wl->pw->pw_dir, 1);

Loading…
Cancel
Save