Permalink
Browse files

SHELL environment variable is now properly set under X.

  • Loading branch information...
1 parent 759cd23 commit 8ebf9157954387135736cb33289d899ed5a41d03 @Nadrin committed Nov 1, 2011
Showing with 4 additions and 3 deletions.
  1. +1 −1 include/libxlsh.h
  2. +3 −2 src/xlsh.c
View
2 include/libxlsh.h
@@ -8,7 +8,7 @@
#define __XLSH_LIBXLSH_H
#define XLSH_VERSION_API 2
-#define XLSH_VERSION_STRING "0.2.1"
+#define XLSH_VERSION_STRING "0.2.2"
#define XLSH_EOK 0x00
#define XLSH_EFATAL 0x01
View
5 src/xlsh.c
@@ -310,7 +310,7 @@ int xlsh_session_exec(pam_handle_t* handle, const char* session, const char* arg
if(getenv("TERM"))
strncpy(terminal, getenv("TERM"), 256);
else
- terminal[0] = 0;
+ *terminal = 0;
clearenv();
setenv("USER", pwinfo->pw_name, 1);
@@ -319,14 +319,15 @@ int xlsh_session_exec(pam_handle_t* handle, const char* session, const char* arg
setenv("PATH", xlsh_config[XLSH_ID_PATH].value, 1);
if(xlsh_X) {
+ setenv("SHELL", pwinfo->pw_shell, 1);
setenv("DISPLAY", xlsh_config[XLSH_ID_DISPLAY].value, 1);
if(libxlsh_proc_exec(XLSH_XRDB, 0) > 0)
wait(&proc_wait);
}
else
setenv("SHELL", session, 1);
- if(terminal[0])
+ if(*terminal)
setenv("TERM", terminal, 1);
execlp(session, _arg0, (char*)0);

0 comments on commit 8ebf915

Please sign in to comment.