PERFORCE change 70148 for review

Dag-Erling Smorgrav des at FreeBSD.org
Wed Feb 2 06:07:18 PST 2005


http://perforce.freebsd.org/chv.cgi?CH=70148

Change 70148 by des at des.at.des.thinksec.com on 2005/02/02 14:07:11

	Sort cross-references in dictionary order.
	
	Requested by:	ru@

Affected files ...

.. //depot/projects/openpam/misc/gendoc.pl#30 edit

Differences ...

==== //depot/projects/openpam/misc/gendoc.pl#30 (text+ko) ====

@@ -32,7 +32,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $P4: //depot/projects/openpam/misc/gendoc.pl#29 $
+# $P4: //depot/projects/openpam/misc/gendoc.pl#30 $
 #
 
 use strict;
@@ -341,13 +341,21 @@
     $func->{'errors'} = [ sort(keys(%errors)) ];
 }
 
+sub dictionary_order($$) {
+    my ($a, $b) = @_;
+
+    $a =~ s/[^[:alpha:]]//g;
+    $b =~ s/[^[:alpha:]]//g;
+    $a cmp $b;
+}
+
 sub genxref($) {
     my $xref = shift;		# References
 
     my $mdoc = '';
     my @refs = ();
     foreach my $sect (sort(keys(%{$xref}))) {
-	foreach my $page (sort(keys(%{$xref->{$sect}}))) {
+	foreach my $page (sort(dictionary_order keys(%{$xref->{$sect}}))) {
 	    push(@refs, "$page $sect");
 	}
     }


More information about the p4-projects mailing list