summaryrefslogtreecommitdiffstats
path: root/usr.bin/grep/queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/grep/queue.c')
-rw-r--r--usr.bin/grep/queue.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/grep/queue.c b/usr.bin/grep/queue.c
index 1887888..4531833 100644
--- a/usr.bin/grep/queue.c
+++ b/usr.bin/grep/queue.c
@@ -53,7 +53,10 @@ static unsigned long long count;
static struct qentry *dequeue(void);
-void
+/*
+ * Enqueue another line; return true if we've dequeued a line as a result
+ */
+bool
enqueue(struct str *x)
{
struct qentry *item;
@@ -72,7 +75,9 @@ enqueue(struct str *x)
item = dequeue();
free(item->data.dat);
free(item);
+ return (true);
}
+ return (false);
}
static struct qentry *
@@ -95,7 +100,7 @@ printqueue(void)
struct qentry *item;
while ((item = dequeue()) != NULL) {
- printline(&item->data, '-', NULL, 0);
+ grep_printline(&item->data, '-');
free(item->data.dat);
free(item);
}
OpenPOWER on IntegriCloud