Date: Mon, 16 Jul 2007 12:21:10 +0300 From: Giorgos Keramidas <keramida@FreeBSD.org> To: Christos Zoulas <christos@zoulas.com> Cc: Mark Peek <mp@FreeBSD.org>, tcsh-bugs@mx.gw.com, kris@FreeBSD.org, current@FreeBSD.org Subject: Re: tcsh backtick hang info Message-ID: <20070716092109.GB2568@kobe.laptop> In-Reply-To: <20070716030052.1B43D56407@rebar.astron.com> References: <20070714005559.GB6661@kobe.laptop> <20070716030052.1B43D56407@rebar.astron.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2007-07-15 23:00, Christos Zoulas <christos@zoulas.com> wrote:
> On Jul 14, 3:55am, keramida@freebsd.org (Giorgos Keramidas) wrote:
> | Hi Christos,
> |
> | Can we persuade you to include the following local patch I keep for
> | autologout detection with /dev/pts/XXX ptys in FreeBSD?
> |
> | %%%
> | Fix pty detection logic of tcsh autologout initialization.
> |
> | Noticed by: kris
> |
> | diff --git a/contrib/tcsh/sh.c b/contrib/tcsh/sh.c
> | --- a/contrib/tcsh/sh.c
> | +++ b/contrib/tcsh/sh.c
> | @@ -457,7 +457,7 @@ main(int argc, char **argv)
> | if (*cp) {
> | /* only for login shells or root and we must have a tty */
> | if ((cp2 = Strrchr(cp, (Char) '/')) != NULL) {
> | - cp = cp2 + 1;
> | + cp2 = cp2 + 1;
> | }
> | else
> | cp2 = cp;
> | %%%
>
> The code is wrong but I think that the fix is not exactly right... The
> following should work:
>
> /* only for login shells or root and we must have a tty */
> if ((cp2 = Strrchr(cp, (Char) '/')) != NULL) {
> cp2 = cp2 + 1;
> }
> else
> cp2 = cp;
> if (!(((Strncmp(cp2, STRtty, 3) == 0) && Isalpha(cp2[3])) ||
> Strstr(cp, Strslptssl) != NULL)) {
> if (getenv("DISPLAY") == NULL) {
> /* NOT on X window shells */
> setcopy(STRautologout, STRdefautologout, VAR_READWRITE);
Ah! Much better indeed. I'm happy a fix is going to be in upstream
tcsh now :-)
> Thanks for the bug report. wonder how come nobody complained for
> years!
This was really brought to my notice by Kris Kennaway, so he's the one
we should thank.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070716092109.GB2568>
