[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
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@logicsquad.net mailto:phoadley@maths.adelaide.edu.au
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]