summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarstr\xf6m <john@ankarstrom.se>2021-06-02 14:17:04 +0200
committerJohn Ankarstr\xf6m <john@ankarstrom.se>2021-06-02 14:17:04 +0200
commit18a4b6dde277f1a127cf1d8ce81accc2f47aae1a (patch)
tree6340b718457cbcd4c8218f339db3f37d5993a30a
parentb61fcab3baf91ecd4b2ad4185e591cf339ad2b34 (diff)
downloadref-18a4b6dde277f1a127cf1d8ce81accc2f47aae1a.tar.gz
Output Sr/Se (source/end of source) macros
These should be defined by the user and interpreted by troff.
-rwxr-xr-xre7
1 files 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: