@@ -297,10 +297,10 @@ BEGIN
297
297
298
298
# The 'default' value consists of a list of triplets in the form
299
299
# (label, link, position) where position is the label after which
300
- # to inster the link and link is a format string where %n expands
300
+ # to insert the link and link is a format string where %n expands
301
301
# to the project name, %f to the project path within the filesystem,
302
302
# %h to the current hash (h gitweb parameter) and %b to the current
303
- # hash base (hb gitweb parameter).
303
+ # hash base (hb gitweb parameter); %% expands to % .
304
304
305
305
# To enable system wide have in $GITWEB_CONFIG e.g.
306
306
# $feature{'actions'}{'default'} = [('graphiclog',
@@ -3085,14 +3085,19 @@ sub git_print_page_nav {
3085
3085
$arg {' tree' }{' hash_base' } = $treebase if defined $treebase ;
3086
3086
3087
3087
my @actions = gitweb_check_feature(' actions' );
3088
+ my %repl = (
3089
+ ' %' => ' %' ,
3090
+ ' n' => $project , # project name
3091
+ ' f' => $git_dir , # project path within filesystem
3092
+ ' h' => $treehead || ' ' , # current hash ('h' parameter)
3093
+ ' b' => $treebase || ' ' , # hash base ('hb' parameter)
3094
+ );
3088
3095
while (@actions ) {
3089
- my ($label , $link , $pos ) = (shift (@actions ), shift (@actions ), shift (@actions ));
3096
+ my ($label , $link , $pos ) = splice (@actions ,0,3);
3097
+ # insert
3090
3098
@navs = map { $_ eq $pos ? ($_ , $label ) : $_ } @navs ;
3091
3099
# munch munch
3092
- $link =~ s # %n# $project # g ;
3093
- $link =~ s # %f# $git_dir # g ;
3094
- $treehead ? $link =~ s # %h# $treehead # g : $link =~ s # %h## g ;
3095
- $treebase ? $link =~ s # %b# $treebase # g : $link =~ s # %b## g ;
3100
+ $link =~ s / %([%nfhb])/ $repl {$1 }/ g ;
3096
3101
$arg {$label }{' _href' } = $link ;
3097
3102
}
3098
3103
0 commit comments