This is the mail archive of the
docbook-apps@lists.oasis-open.org
mailing list .
Sorting bug in fo/pdf2index
- From: "Paul A. Hoadley" <paulh at logicsquad dot net>
- To: docbook-apps at lists dot oasis-open dot org
- Date: Wed, 19 Mar 2003 21:39:26 +1030
- Subject: Sorting bug in fo/pdf2index
Hello,
I've been using fo/pdf2index to clean up FO indexes. The results are
good, with the exception that pdf2index seems to be sorting numbers
lexically rather than numerically. The culprit is in 'sub rangesort',
and, in fact, the following tiny patch will fix it:
--- pdf2index.orig Wed Mar 19 20:56:11 2003
+++ pdf2index Wed Mar 19 20:56:25 2003
@@ -114,7 +114,7 @@
# Make sure roman pages come before arabic ones, otherwise sort them in order
return -1 if ($apno !~ /^\d+/ && $bpno =~ /^\d+/);
return 1 if ($apno =~ /^\d+/ && $bpno !~ /^\d+/);
- return $apno cmp $bpno;
+ return $apno <=> $bpno;
}
sub rangelen {
I will file this at SourceForge.
--
Paul.
mailto:paulh at logicsquad dot net
mailto:phoadley at maths dot adelaide dot edu dot au