From aa4bcfb5def020061a323fa0e156b0259d0fc4ab Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Sat, 29 Aug 2015 18:55:55 +0200 Subject: [PATCH] ocat: make --limit work for RAW mode --- storage.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/storage.c b/storage.c index 53d9ed1..105eefe 100644 --- a/storage.c +++ b/storage.c @@ -506,6 +506,10 @@ static int candidate_line(char *line, void *param) } } + if (limit > 0 && otype == RAW) { + printf("%s\n", line); + return (1); /* make it 'count' or tac() will not decrement line counter and continue until EOF */ + } /* Do we have location line? */ if ((bp = strstr(line, "Z\t* ")) == NULL) { /* Not a location line */