From 1e71cb9f7313baf6e43e3ba4c28acb4ddd54c7ba Mon Sep 17 00:00:00 2001
From: Marcel Loose <loose@astron.nl>
Date: Fri, 9 Apr 2010 12:22:20 +0000
Subject: [PATCH] Bug 1503: Fixed problem with displaying documentation in the
 Software TreeBrowser when directory name contains an underscore

---
 LCS/Tools/src/pkgdep.cc                          |  2 +-
 support/tools/TreeBrowser/scripts/make_links.php | 15 ++++++++-------
 support/tools/TreeBrowser/scripts/makepage.php   |  8 +++-----
 3 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/LCS/Tools/src/pkgdep.cc b/LCS/Tools/src/pkgdep.cc
index 367ef0f571f..83de41e4d60 100644
--- a/LCS/Tools/src/pkgdep.cc
+++ b/LCS/Tools/src/pkgdep.cc
@@ -68,7 +68,7 @@ string replaceSlash (const string& str)
   string out = str;
   string::size_type idx = out.find('/');
   while (idx != string::npos) {
-    out.replace (idx, 1, 1, '_');
+    out.replace (idx, 1, 1, '~');
     idx = out.find('/');
   }
   return out;
diff --git a/support/tools/TreeBrowser/scripts/make_links.php b/support/tools/TreeBrowser/scripts/make_links.php
index 5e24cd1ae92..4725f21ed08 100644
--- a/support/tools/TreeBrowser/scripts/make_links.php
+++ b/support/tools/TreeBrowser/scripts/make_links.php
@@ -1,6 +1,6 @@
 <?php
 $name = $_REQUEST["name"];
-$realname= str_replace("_","/",$name);
+$realname= str_replace("~","/",$name);
 $isUsed=file_exists("../dep/".$name.".used.html");
 $isUses=file_exists("../dep/".$name.".uses.html");
 $isFlat=file_exists("../dep/".$name.".flat.html");
@@ -22,7 +22,8 @@ echo $realname;
 if ($isUsed) {
 ?>
   --  <a href="../dep/<?php echo $name;?>.used.html" title="(shows in a
-  recursive way the packages where <?php echo $name;?> is used)" target="depend"> Used </a>
+  recursive way the packages where <?php echo $realname;?> is used)" 
+  target="depend"> Used</a>
 <?php
 } else {
 ?>
@@ -34,7 +35,8 @@ if ($isUsed) {
 if ($isUses) {
 ?>
   --  <a href="../dep/<?php echo $name;?>.uses.html" title="(shows in a
-  recursive way the packages used by <?php echo $name;?>)" target="depend"> Uses </a>
+  recursive way the packages used by <?php echo $realname;?>)" 
+  target="depend"> Uses</a>
 <?php
 } else {
 ?>
@@ -46,13 +48,12 @@ if ($isUses) {
 if ($isFlat) {
 ?>
   --  <a href="../dep/<?php echo $name;?>.flat.html" title="(shows the
-  packages used by <?php echo $name;?>)" target="depend"> Flat </a>
+  packages used by <?php echo $realname;?>)" target="depend"> Flat</a>
 <?php
 }
 ?>
- --- Build results: 
-    <A HREF="../../BuildResults/thisWeek/" target="_top">this week</a>
- -- <A HREF="../../BuildResults/lastWeek/" target="_top">last week</a>
+  ---  <a href="http://svn.astron.nl/CDash/index.php?project=LOFAR" 
+  target="_blank">Build results</a>
 </center>
 </body>
 </html>
diff --git a/support/tools/TreeBrowser/scripts/makepage.php b/support/tools/TreeBrowser/scripts/makepage.php
index 667f093a2cc..1ebc5f00a0f 100644
--- a/support/tools/TreeBrowser/scripts/makepage.php
+++ b/support/tools/TreeBrowser/scripts/makepage.php
@@ -1,9 +1,7 @@
 <?php
-$name      = $_REQUEST["name"];
-$realname  = str_replace("_","/",$name);
-$namearray = explode('_',$name);
-$shortname = $namearray[sizeof($namearray)-1];
-$docname   = "group__".$shortname.".html";
+$name     = $_REQUEST["name"];
+$realname = str_replace("~","/",$name);
+$docname  = "group__" .str_replace("_","__",end(explode('~',$name))). ".html";
 ?>
 <html>
 <head>
-- 
GitLab