<div dir="ltr"><div class="gmail_default" style="font-family:monospace,monospace;font-size:small">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.<br><br clear="all"></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><span style="font-family:monospace,monospace">David Kaspar [Dee'Kej]</span><i><span style="font-family:monospace,monospace"><br>Associate Software Engineer</span></i><span style="font-family:monospace,monospace"><i><br>Brno, Czech Republic</i></span><br><span style="font-family:monospace,monospace"></span></div></div><span style="font-family:monospace,monospace"><br></span></div><span style="font-family:monospace,monospace"><span style="color:rgb(204,0,0)">RED HAT</span> | <span style="color:rgb(204,0,0)">TRIED</span>. <span style="color:rgb(204,0,0)">TESTED</span>. <span style="color:rgb(204,0,0)">TRUSTED</span>.<br>Every airline in the Fortune 500 relies on Red Hat.<br>Find out why at <a href="http://www.redhat.com/en/about/trusted" target="_blank">Trusted | Red Hat</a>.<br></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Aug 27, 2018 at 2:36 PM Christos Zoulas <<a href="mailto:christos@zoulas.com">christos@zoulas.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Aug 27, 1:54pm, <a href="mailto:dkaspar@redhat.com" target="_blank">dkaspar@redhat.com</a> ("David Kaspar [Dee'Kej]") wrote:<br>
-- Subject: Re: [Tcsh] Discard ~/.history when it grows over reasonable size<br>
<br>
| > diff --git a/sh.lex.c b/sh.lex.c<br>
| > index fee790a..091410e 100644<br>
| > --- a/sh.lex.c<br>
| > +++ b/sh.lex.c<br>
| > @@ -1522,6 +1522,8 @@ reread:<br>
| > onelflg--;<br>
| > } while (c == 0);<br>
| > Strbuf_append1(&histline, c);<br>
| > + if (histline.len >= INBUFSIZE)<br>
| > + return CHAR_ERR;<br>
| > return (c);<br>
| > }<br>
| ><br>
| > I have actually tried similar approach before, but it didn't work. And<br>
| unfortunately, this also leads to to tcsh eating all of the memory and<br>
| triggering OOM killer... :-/<br>
| <br>
| I would like to tell you why is that, but I haven't fully understood yet<br>
| how the lexical analyzer of tcsh work.<br>
| <br>
| So far, only the patch I have sent you works (partially).<br>
<br>
How can I test it?<br>
<br>
christos<br>
</blockquote></div>