"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "code2color" between
lesspipe-1.85.tar.gz and lesspipe-1.86.tar.gz

About: lesspipe is an input filter for the pager "less" to view files with binary content, compressed files, archives and files contained in archives.

code2color  (lesspipe-1.85):code2color  (lesspipe-1.86)
skipping to change at line 3047 skipping to change at line 3047
} ] } ]
}; };
$LANGUAGE{'sh'} = $LANGUAGE{'shellscript'}; $LANGUAGE{'sh'} = $LANGUAGE{'shellscript'};
return \%LANGUAGE; return \%LANGUAGE;
}; };
use Getopt::Std; use Getopt::Std;
getopts('i:l:') || exit 2; getopts('i:l:') || exit 2;
# external colorizer ? # external colorizer ?
if ( $ENV{LESSCOLORIZER} and basename($ENV{LESSCOLORIZER}) ne 'code2color' ) { if ( $ENV{LESSCOLORIZER} and $ENV{LESSCOLORIZER} !~ m"(/|^)code2color(\s|$)" ) {
# for security reasons do accept only a limited set of colorizers # for security reasons do accept only a limited set of colorizers
die "$ENV{LESSCOLORIZER} is not an allowed colorizer, use one of ", die "$ENV{LESSCOLORIZER} is not an allowed colorizer, use one of ",
join(', ',@colorizers), " instead\n" join(', ',@colorizers), " instead\n"
if ! grep {basename($ENV{LESSCOLORIZER}) eq $_} @colorizers; if ! grep { $ENV{LESSCOLORIZER} =~ m"(/|^)$_(\s|$)" } @colorizers;
die "$ENV{LESSCOLORIZER} not found or not an executable\n" die "$ENV{LESSCOLORIZER} not found or not an executable\n"
if ! -x $ENV{LESSCOLORIZER} if ! -x $ENV{LESSCOLORIZER}
and ! grep { -x "$_/$ENV{LESSCOLORIZER}" } split /:/, $ENV{PATH}; and ! grep { -x "$_/$ENV{LESSCOLORIZER}" } split /:/, $ENV{PATH};
# call external colorizer # call external colorizer
if ($ENV{LESSCOLORIZER} eq 'pygmentize') { if ($ENV{LESSCOLORIZER} =~ m"(/|^)pygmentize(\s|$)" ) {
# do not call pygmentize with - and use option -g # do not call pygmentize with - and use option -g
@ARGV = grep {$_ ne '-'} @ARGV; @ARGV = grep {$_ ne '-'} @ARGV;
unshift @ARGV, '-g'; unshift @ARGV, '-g';
} }
system($ENV{LESSCOLORIZER}, @ARGV); system($ENV{LESSCOLORIZER}, @ARGV);
exit; exit;
} }
$str = main(parse_passed_params( infile => $ARGV[0] || '-', $str = main(parse_passed_params( infile => $ARGV[0] || '-',
outfile => '-', outfile => '-',
# linenumbers => 1 , # linenumbers => 1 ,
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)