summary refs log tree commit diff
path: root/bin
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
commit90b47ca285a6fa0b970e338afa723606cfe68c53 (patch)
treea7aa0209f2afb2fc1610df3e1ea204951e728ad1 /bin
parentStop polling stdin after EOF (diff)
downloadsrc-90b47ca285a6fa0b970e338afa723606cfe68c53.tar.gz
src-90b47ca285a6fa0b970e338afa723606cfe68c53.zip
Set line number on File lines
Diffstat (limited to 'bin')
-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];