summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-05-04 12:25:48 -0400
committerJune McEnroe <june@causal.agency>2021-05-04 12:25:48 -0400
commita8166fdc6c9809f3aa2b2b474df9534bf80d3dce (patch)
treec10343ecfd410eaaccc33223f4369437c54bb6ab /bin
parentEmulate MANSECT for mandoc which lacks it (diff)
downloadsrc-a8166fdc6c9809f3aa2b2b474df9534bf80d3dce.tar.gz
src-a8166fdc6c9809f3aa2b2b474df9534bf80d3dce.zip
Handle missing last names in bibsort
Diffstat (limited to 'bin')
-rw-r--r--bin/bibsort.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/bibsort.pl b/bin/bibsort.pl
index 89133c87..0d132c19 100644
--- a/bin/bibsort.pl
+++ b/bin/bibsort.pl
@@ -26,7 +26,7 @@ while (<>) {
 sub byLast {
 	my ($af, $al) = split /\s(\S+)(,.*)?$/, $a;
 	my ($bf, $bl) = split /\s(\S+)(,.*)?$/, $b;
-	$al cmp $bl || $af cmp $bf;
+	($al // $af) cmp ($bl // $bf) || $af cmp $bf;
 }
 
 foreach $ref (@refs) {