[Tcsh] Discard ~/.history when it grows over reasonable size
David Kaspar [Dee'Kej]
dkaspar at redhat.com
Mon Aug 27 08:54:24 EDT 2018
I have asked our customer if it is possible to share the corrupted .history
file with you. If not, I will try to craft one for you. I'll let you know
once I know something.
David Kaspar [Dee'Kej]
*Associate Software Engineer*
*Brno, Czech Republic*
RED HAT | TRIED. TESTED. TRUSTED.
Every airline in the Fortune 500 relies on Red Hat.
Find out why at Trusted | Red Hat <http://www.redhat.com/en/about/trusted>.
On Mon, Aug 27, 2018 at 2:36 PM Christos Zoulas <christos at zoulas.com> wrote:
> On Aug 27, 1:54pm, dkaspar at redhat.com ("David Kaspar [Dee'Kej]") wrote:
> -- Subject: Re: [Tcsh] Discard ~/.history when it grows over reasonable
> size
>
> | > diff --git a/sh.lex.c b/sh.lex.c
> | > index fee790a..091410e 100644
> | > --- a/sh.lex.c
> | > +++ b/sh.lex.c
> | > @@ -1522,6 +1522,8 @@ reread:
> | > onelflg--;
> | > } while (c == 0);
> | > Strbuf_append1(&histline, c);
> | > + if (histline.len >= INBUFSIZE)
> | > + return CHAR_ERR;
> | > return (c);
> | > }
> | >
> | > I have actually tried similar approach before, but it didn't work. And
> | unfortunately, this also leads to to tcsh eating all of the memory and
> | triggering OOM killer... :-/
> |
> | I would like to tell you why is that, but I haven't fully understood yet
> | how the lexical analyzer of tcsh work.
> |
> | So far, only the patch I have sent you works (partially).
>
> How can I test it?
>
> christos
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.astron.com/pipermail/tcsh/attachments/20180827/47614a03/attachment.html>
More information about the Tcsh
mailing list