diff options
| author | fukachan <fukachan> | 2002-04-22 04:02:01 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-04-22 04:02:01 +0000 |
| commit | 2f1175911203a9d3236f0a48f57674ce88664f3a (patch) | |
| tree | eadfaee3c6143637104a4ba6966f0980cc4ca2b8 /fml/lib/FML/Command/HTMLify.pm | |
| parent | a5dc5fb920341e14a4c35c736ece94eddc9129cb (diff) | |
| download | fml8-2f1175911203a9d3236f0a48f57674ce88664f3a.tar.gz fml8-2f1175911203a9d3236f0a48f57674ce88664f3a.tar.bz2 fml8-2f1175911203a9d3236f0a48f57674ce88664f3a.zip | |
bug fix subdirs sorting algorithm
Diffstat (limited to 'fml/lib/FML/Command/HTMLify.pm')
| -rw-r--r-- | fml/lib/FML/Command/HTMLify.pm | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/fml/lib/FML/Command/HTMLify.pm b/fml/lib/FML/Command/HTMLify.pm index 77dd6031..9a0371eb 100644 --- a/fml/lib/FML/Command/HTMLify.pm +++ b/fml/lib/FML/Command/HTMLify.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: HTMLify.pm,v 1.1 2002/04/20 05:02:28 fukachan Exp $ +# $FML: HTMLify.pm,v 1.2 2002/04/21 04:54:30 fukachan Exp $ # package FML::Command::HTMLify; @@ -54,7 +54,9 @@ sub convert } if ($is_subdir_exists) { - for my $xdir (sort {$a <=> $b} @$subdirs) { + my (@x) = sort _sort_subdirs @$subdirs; + print STDERR "subdirs; @x \n"; + for my $xdir (sort _sort_subdirs @$subdirs) { eval q{ use Mail::Message::ToHTML; &Mail::Message::ToHTML::htmlify_dir($xdir, { @@ -80,6 +82,20 @@ sub convert } +# Descriptions: sort subdirs by the last dirname +# Arguments: implicit ($a, $b) +# Side Effects: none +# Return Value: NUM(-1, 0, 1) +sub _sort_subdirs +{ + my ($xa, $xb); + + if ($a =~ /(\d+)$/) { $xa = $1;} + if ($b =~ /(\d+)$/) { $xb = $1;} + + $xa <=> $xb; +} + # Descriptions: check wheter $src_dir has sub-directories in it # Arguments: STR($src_dir) # Side Effects: none |
