From 0997e74e2b6bf8d6a3b9e31357e409132a8fef23 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Fri, 18 Dec 2020 20:44:48 -0500 Subject: Fix bibsort name sorting for middle names, trailing titles Correctly sorts "Kevin L. Mitchell" and "K. Zeilenga, Ed." for example. --- bin/bibsort.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/bibsort.pl b/bin/bibsort.pl index 5f0ad7ba..f87f066f 100644 --- a/bin/bibsort.pl +++ b/bin/bibsort.pl @@ -24,8 +24,8 @@ while (<>) { } sub byLast { - my ($af, $al) = split /\s/, $a, 2; - my ($bf, $bl) = split /\s/, $b, 2; + my ($af, $al) = split /\s(\S+)(,.*)?$/, $a; + my ($bf, $bl) = split /\s(\S+)(,.*)?$/, $b; $al cmp $bl || $af cmp $bf; } -- cgit 1.4.1