Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

XLSH_PROMPT is no longer set from environment. Changed default prompt.

  • Loading branch information...
commit 5857bd852ffe324c81beac77dcfc4fac8655be81 1 parent ad3e30c
@Nadrin authored
Showing with 5 additions and 9 deletions.
  1. +1 −1  include/config.h
  2. +2 −2 include/xlsh.h
  3. +2 −6 src/xlsh.c
View
2  include/config.h
@@ -10,7 +10,7 @@
// Tweak parameters to suit your needs before compiling.
#define XLSH_EXEC "./.xsession"
-#define XLSH_PROMPT "%s> "
+#define XLSH_PROMPT "xlsh (%s)> "
#define XLSH_TMPDIR "/tmp"
#define XLSH_SHELLS "/etc/shells"
#define XLSH_ISSUE "/etc/issue"
View
4 include/xlsh.h
@@ -11,7 +11,6 @@ typedef enum xlsh_config_id_e {
XLSH_ID_EXEC = 0,
XLSH_ID_REBOOT,
XLSH_ID_HALT,
- XLSH_ID_PROMPT,
XLSH_ID_ISSUE,
XLSH_ID_DATEFMT,
XLSH_ID_TIMEFMT,
@@ -52,8 +51,9 @@ int xlsh_cmd_loop(void);
char* xlsh_session_getpass(char* buffer, size_t bufsize);
char* xlsh_session_getstring(char* buffer, size_t bufsize);
+
int xlsh_session_open(const char* service, const char* user,
- pam_handle_t** handle);
+ pam_handle_t** handle);
int xlsh_session_close(pam_handle_t* handle);
int xlsh_session_exec(pam_handle_t* handle, const char* session, const char* arg0);
View
8 src/xlsh.c
@@ -32,7 +32,6 @@ static xlsh_config_item_t xlsh_config[] = {
{ "XLSH_EXEC", XLSH_EXEC, NULL },
{ "XLSH_REBOOT", XLSH_REBOOT, NULL },
{ "XLSH_HALT", XLSH_HALT, NULL },
- { "XLSH_PROMPT", XLSH_PROMPT, NULL },
{ "XLSH_ISSUE", XLSH_ISSUE, NULL },
{ "XLSH_DATEFMT", XLSH_DATEFMT, NULL },
{ "XLSH_TIMEFMT", XLSH_TIMEFMT, NULL },
@@ -450,7 +449,6 @@ void xlsh_config_init(char* exec_arg)
xlsh_config_set(&xlsh_config[XLSH_ID_REBOOT], NULL);
xlsh_config_set(&xlsh_config[XLSH_ID_HALT], NULL);
- xlsh_config_set(&xlsh_config[XLSH_ID_PROMPT], NULL);
xlsh_config_set(&xlsh_config[XLSH_ID_ISSUE], NULL);
xlsh_config_set(&xlsh_config[XLSH_ID_TIMEFMT], NULL);
xlsh_config_set(&xlsh_config[XLSH_ID_DATEFMT], NULL);
@@ -507,9 +505,7 @@ int xlsh_cmd_loop(void)
int retvalue = XLSH_EOK;
xlsh_sys_getinfo(&sysinfo);
- snprintf(prompt, 256,
- xlsh_config[XLSH_ID_PROMPT].value,
- sysinfo.ttyname);
+ snprintf(prompt, 256, XLSH_PROMPT, sysinfo.ttyname);
while((line = xlsh_cmd_readline(prompt))) {
cmd_argc = 0;
@@ -626,7 +622,7 @@ int xlsh_sys_issue(const char* issuefile)
curptr += (printf("%s", curptr) + 2);
if(value)
- printf("%s", value);
+ printf("%s", value);
}
else
curptr += printf("%s", curptr);
Please sign in to comment.
Something went wrong with that request. Please try again.