summary refs log tree commit diff
path: root/rfc/rfctags.pl
diff options
context:
space:
mode:
Diffstat (limited to 'rfc/rfctags.pl')
-rw-r--r--rfc/rfctags.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/rfc/rfctags.pl b/rfc/rfctags.pl
index cd3ba288..5833e17a 100644
--- a/rfc/rfctags.pl
+++ b/rfc/rfctags.pl
@@ -5,15 +5,16 @@ use open ':encoding(ISO-8859-1)';
 use IO::Uncompress::Gunzip qw($GunzipError);
 
 ($,, $\) = ("\t", "\n");
+print '!_TAG_FILE_SORTED', 2, $0; # Promise to pipe this through sort -f
 for my $rfc (<*.txt.gz>) {
 	my $handle = new IO::Uncompress::Gunzip $rfc
 		or die "${rfc}: ${GunzipError}";
 	while (<$handle>) {
 		chomp;
 		# Section headings
-		if (/^([\d.]+|[A-Z][.])\s+([^\t]+)/) {
+		if (/^([\d.]+|[A-Z][.])\s+([^\t]+)?/) {
 			print $1, $rfc, $.;
-			print $2, $rfc, $.;
+			print $2, $rfc, $. if $2;
 		}
 		# References
 		if (/^\s*(\[[\w-]+\])\s{2,}/) {