diff options
Diffstat (limited to 'contrib/tcsh/sh.c')
-rw-r--r-- | contrib/tcsh/sh.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/contrib/tcsh/sh.c b/contrib/tcsh/sh.c index dd871727d2aa..d888e8e91d21 100644 --- a/contrib/tcsh/sh.c +++ b/contrib/tcsh/sh.c @@ -179,7 +179,7 @@ add_localedir_to_nlspath(const char *path) if (path == NULL) return; - (void) xsnprintf(trypath, sizeof(trypath), "%s/en/LC_MESSAGES/tcsh.cat", + (void) xsnprintf(trypath, sizeof(trypath), "%s/C/LC_MESSAGES/tcsh.cat", path); if (stat(trypath, &st) == -1) return; @@ -1249,7 +1249,7 @@ main(int argc, char **argv) * was a session leader . */ else if (shpgrp != mygetpgrp()) { - if(setpgid(0, shpgrp) == -1) { + if (setpgid(0, shpgrp) == -1) { xprintf("setpgid:"); goto notty; } @@ -1839,6 +1839,10 @@ exitstat(void) void phup(void) { + static int again = 0; + if (again++) + return; + if (loginsh) { setcopy(STRlogout, STRhangup, VAR_READWRITE); #ifdef _PATH_DOTLOGOUT @@ -2516,11 +2520,20 @@ defaultpath(void) static void record(void) { + static int again = 0; + int ophup_disabled; + + if (again++) + return; + + ophup_disabled = phup_disabled; + phup_disabled = 1; if (!fast) { recdirs(NULL, adrof(STRsavedirs) != NULL); rechist(NULL, adrof(STRsavehist) != NULL); } displayHistStats("Exiting"); /* no-op unless DEBUG_HIST */ + phup_disabled = ophup_disabled; } /* |