mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-10 06:07:43 +02:00
buffer-limit option.
This commit is contained in:
7
paste.c
7
paste.c
@ -1,4 +1,4 @@
|
||||
/* $Id: paste.c,v 1.2 2008-06-20 17:31:48 nicm Exp $ */
|
||||
/* $Id: paste.c,v 1.3 2008-06-20 18:45:35 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -97,10 +97,13 @@ paste_free_index(struct paste_stack *ps, u_int idx)
|
||||
}
|
||||
|
||||
void
|
||||
paste_add(struct paste_stack *ps, const char *data)
|
||||
paste_add(struct paste_stack *ps, const char *data, u_int limit)
|
||||
{
|
||||
struct paste_buffer *pb;
|
||||
|
||||
while (ARRAY_LENGTH(ps) >= limit)
|
||||
ARRAY_TRUNC(ps, 1);
|
||||
|
||||
pb = xmalloc(sizeof *pb);
|
||||
ARRAY_INSERT(ps, 0, pb);
|
||||
|
||||
|
Reference in New Issue
Block a user