• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisão3996e01a7f79ee9525521ab22b587dc5af2b2bb7 (tree)
Hora2022-04-10 02:51:29
Autordyknon <dyknon@user...>
Commiterdyknon

Mensagem de Log

better padding + fix cidr handling

Mudança Sumário

Diff

--- a/ip2cc_index.pl
+++ b/ip2cc_index.pl
@@ -328,8 +328,7 @@ sub get_pad_ascii_formatter{
328328 my %len_part = $asciilen{$type}->%*;
329329 my $len = @vals
330330 + (sum0 map{$_->{len}}@vals)
331- + $len_part{addr}
332- + 1;
331+ + $len_part{addr};
333332 if($cidr){
334333 $len += $len_part{cidrnm}+1;
335334 }else{
@@ -337,10 +336,11 @@ sub get_pad_ascii_formatter{
337336 }
338337 my $inner = get_ascii_formatter($type, $cidr, @vals);
339338 sub{
340- my $line = $inner->(@_);
341- my $padn = $len - length $line;
342- die if($padn < 0);
343- "$line\t" . " "x$padn;
339+ map{
340+ my $padn = $len - length $_;
341+ die if($padn < 0);
342+ "$_\t" . " "x$padn;
343+ }$inner->(@_);
344344 };
345345 }
346346 sub get_binary_formatter{
@@ -486,7 +486,7 @@ if($op eq "generate"){
486486 }
487487
488488 my @formats = keys %formatters;
489- @formats = grep{!/^cidr/}@formats if($cidr);
489+ @formats = grep{!/^cidr/}@formats if(!$cidr);
490490
491491 if($address_sort){
492492 for(@formats){