aboutsummaryrefslogtreecommitdiff
path: root/buf.c
diff options
context:
space:
mode:
Diffstat (limited to 'buf.c')
-rw-r--r--buf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/buf.c b/buf.c
index a219773..7e270c3 100644
--- a/buf.c
+++ b/buf.c
@@ -110,3 +110,10 @@ char* peekstrbuf(buf* buffer, size_t loc, size_t len){
}
return str;
}
+char peekchrbuf(buf* buffer, size_t loc){
+ buf_node* start;
+ loc += buffer->pop;
+ for (start = buffer->tail; loc>buffer->cap; loc -= buffer->cap)
+ start = start->next;
+ return start->text[loc];
+}