summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-06-03 11:03:24 -0400
committerJune McEnroe <june@causal.agency>2022-06-03 11:03:24 -0400
commit4d03059127f70e5ef0e8593386649a723c534612 (patch)
treef2b6e7350d670d17d46d8227e37d4741acc1c8de
parentStop polling stdin after EOF (diff)
downloadsrc-4d03059127f70e5ef0e8593386649a723c534612.tar.gz
src-4d03059127f70e5ef0e8593386649a723c534612.zip
Set line number on File lines
-rw-r--r--bin/qf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/qf.c b/bin/qf.c
index aac44fa5..ba20483d 100644
--- a/bin/qf.c
+++ b/bin/qf.c
@@ -68,6 +68,8 @@ static void parse(struct Line line) {
 		push(line);
 		return;
 	}
+	char *rest;
+	line.nr = strtoul(line.text, &rest, 10);
 	struct Line prev = {0};
 	if (lines.len) prev = lines.ptr[lines.len-1];
 	if (!prev.path || strcmp(line.path, prev.path)) {
@@ -75,8 +77,6 @@ static void parse(struct Line line) {
 		line.type = File;
 		push(line);
 	}
-	char *rest;
-	line.nr = strtoul(line.text, &rest, 10);
 	if (rest > line.text && rest[0] == ':') {
 		line.type = Match;
 		line.text = &rest[1];