summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-12-18 20:44:48 -0500
committerJune McEnroe <june@causal.agency>2020-12-18 20:44:48 -0500
commit0997e74e2b6bf8d6a3b9e31357e409132a8fef23 (patch)
tree65fc6b3669a85d6c1edf41646a81c9d4c3b8c018 /bin
parentAdd bibsort (diff)
downloadsrc-0997e74e2b6bf8d6a3b9e31357e409132a8fef23.tar.gz
src-0997e74e2b6bf8d6a3b9e31357e409132a8fef23.zip
Fix bibsort name sorting for middle names, trailing titles
Correctly sorts "Kevin L. Mitchell" and "K. Zeilenga, Ed." for example.
Diffstat (limited to 'bin')
-rw-r--r--bin/bibsort.pl4
1 files changed, 2 insertions, 2 deletions
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;
 }
 
a000b422bd414d&follow=1'>Add hi -f html -o anchor for line number linksJune McEnroe 2019-02-17Simplify temp trap in upJune McEnroe 2019-02-17Add line numbers to hiJune McEnroe Renames previous -n option to -m to stay consistent with cat -n. Prefixing lines with line numbers affects where the first tab indent ends up relative to the text above it. Not sure if it's worth fixing somehow. 2019-02-17Always split spans after newlinesJune McEnroe Simplifies ANSI and IRC output code, and prepares for line numbered output. 2019-02-15Color format specifiers light cyan in vimJune McEnroe 2019-02-15Highlight Interp as yellowJune McEnroe 2019-02-15Highlight strings in sh command substitutionsJune McEnroe 2019-02-15Add nmap gpJune McEnroe 2019-02-14Avoid newline when copying URL to pasteboardJune McEnroe 2019-02-13Add forgotten "sixth" book of H2G2June McEnroe