From 45807db4c6f8524b770ff0ae8581400b6e140c53 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 5 Mar 2020 21:13:43 -0800 Subject: tags: fix off-by-one line numbers for hash bang. * tags.tl (collect-tags): For hash-bang files, pop the dummy blank line that we inserted at the head of the line list to obtain 1-based numbering. If the parser starts working ater the #! line, it means the second line is 1, which is the same as zero-based numbering, so we can lose the dummy entry and all is well. --- tags.tl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tags.tl b/tags.tl index 93ffa965..bb32ee44 100755 --- a/tags.tl +++ b/tags.tl @@ -65,7 +65,8 @@ (stream (make-strlist-input-stream lines)) (*rec-source-loc* t)) (with-stream (stream (open-file path)) - (unless (starts-with "#!" (get-line stream)) + (if (starts-with "#!" (get-line stream)) + (pop lines) (seek-stream stream 0 :from-start)) (build (add (new file-tag -- cgit v1.2.3