diff options
Diffstat (limited to 'app/xterm/main.c')
-rw-r--r-- | app/xterm/main.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/app/xterm/main.c b/app/xterm/main.c index 80e08a74f..4f801b4d9 100644 --- a/app/xterm/main.c +++ b/app/xterm/main.c @@ -1,4 +1,4 @@ -/* $XTermId: main.c,v 1.586 2008/02/28 00:28:00 Matthieu.Herrb Exp $ */ +/* $XTermId: main.c,v 1.587 2008/05/26 18:25:54 Marius.Tolzmann Exp $ */ /* * W A R N I N G @@ -2241,7 +2241,7 @@ main(int argc, char *argv[]ENVP_ARG) c[1 + u] = "--"; command_to_exec_with_luit = c; } else { - static char *luit[4]; + static char *luit[6]; luit[0] = term->misc.localefilter; if (u) { luit[1] = "-encoding"; @@ -4326,7 +4326,7 @@ spawnXTerm(XtermWidget xw) * there, or refuses to run. In that case we will fall-through to * to command that the user gave anyway. */ - if (command_to_exec_with_luit) { + if (command_to_exec_with_luit && command_to_exec) { xtermSetenv("XTERM_SHELL", xtermFindShell(*command_to_exec_with_luit, False)); TRACE(("spawning command \"%s\"\n", *command_to_exec_with_luit)); @@ -4367,6 +4367,22 @@ spawnXTerm(XtermWidget xw) if (xw->misc.login_shell && pw && added_utmp_entry) execl(bin_login, "login", "-p", "-f", login_name, (void *) 0); #endif + +#if OPT_LUIT_PROG + if (command_to_exec_with_luit) { + if (xw->misc.login_shell) { + int u; + u = (term->misc.use_encoding ? 2 : 0); + command_to_exec_with_luit[u + 1] = "-argv0"; + command_to_exec_with_luit[u + 2] = shname_minus; + command_to_exec_with_luit[u + 3] = NULL; + } + execvp(*command_to_exec_with_luit, command_to_exec_with_luit); + /* Exec failed. */ + fprintf(stderr, "%s: Can't execvp %s: %s\n", ProgramName, + *command_to_exec_with_luit, strerror(errno)); + } +#endif execlp(ptr, (xw->misc.login_shell ? shname_minus : shname), (void *) 0); |