[Tcsh] Discard ~/.history when it grows over reasonable size
Christos Zoulas
christos at zoulas.com
Fri Aug 24 11:29:15 EDT 2018
On Aug 24, 2:19pm, dkaspar at redhat.com ("David Kaspar [Dee'Kej]") wrote:
-- Subject: [Tcsh] Discard ~/.history when it grows over reasonable size
I think you want to catch it earlier (while appending characters):
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);
}
christos
More information about the Tcsh
mailing list