From 1181046c9e1ee59fa0e6b6d93591fef7a415ed19 Mon Sep 17 00:00:00 2001 From: Uriel Date: Thu, 6 Aug 2009 02:20:58 +0200 Subject: [PATCH] Fix bug where incorrect elements in the navigation sidebar were highlighted, thanks to arg for reporting this. --- bin/corehandlers.rc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/corehandlers.rc b/bin/corehandlers.rc index f1052ac..88f9189 100644 --- a/bin/corehandlers.rc +++ b/bin/corehandlers.rc @@ -26,7 +26,11 @@ fn nav_tree { path = $0 d gsub(/[\-_]/, " ", bname) - if(index(ENVIRON["req_path"] "/", path) == 1) + # To avoid false matches add trailing / even for plain files to act as delimiter + pa = path + gsub(/[^\/]$/, "&/", pa) + + if(index(ENVIRON["req_path"] "/", pa) == 1) print "
  • » " bname "
  • " else print "
  • › " bname "
  • "