From 18a4b6dde277f1a127cf1d8ce81accc2f47aae1a Mon Sep 17 00:00:00 2001 From: "John Ankarstr\\xf6m" Date: Wed, 2 Jun 2021 14:17:04 +0200 Subject: Output Sr/Se (source/end of source) macros These should be defined by the user and interpreted by troff. --- re | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/re b/re index 8e0677e..934a137 100755 --- a/re +++ b/re @@ -100,10 +100,10 @@ while (<$fh>) { if ($bytes == $ref_bytes) { shift @references; my $file = $files{$bytes}; - my $end = shift @{$file_locations{$file}}; + my $end = shift @{$file_locations{$file}} || ''; my $loc = $locations{$bytes}; - print "\n$file:$loc-$end\n"; + print ".Sr $file $loc-$end\n"; seek $handles{$file}, $loc, 0; local $_; @@ -113,6 +113,9 @@ while (<$fh>) { last if $end and $bytes > $end; print; } + + print ".Se\n"; + next; } normal: -- cgit v1.2.3