$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r52237 - trunk/tools/quickbook/detail
From: daniel_james_at_[hidden]
Date: 2009-04-07 15:26:18
Author: danieljames
Date: 2009-04-07 15:26:18 EDT (Tue, 07 Apr 2009)
New Revision: 52237
URL: http://svn.boost.org/trac/boost/changeset/52237
Log:
Fix calculate_relative_path
When outdir == "." calculate_relative_path was counting that dot as a
directory and adding an extra ".." to the result. So only count parts
that don't equal ".".
Refs #2921
Text files modified: 
   trunk/tools/quickbook/detail/actions.cpp |     9 ++++++---                               
   1 files changed, 6 insertions(+), 3 deletions(-)
Modified: trunk/tools/quickbook/detail/actions.cpp
==============================================================================
--- trunk/tools/quickbook/detail/actions.cpp	(original)
+++ trunk/tools/quickbook/detail/actions.cpp	2009-04-07 15:26:18 EDT (Tue, 07 Apr 2009)
@@ -935,10 +935,13 @@
             if(!fs::equivalent(outtmp /= *out, temp /= *file))
                 break;
         }
-        std::divides<fs::path> concat;
         out = (out == outdir.begin()) ? outdir.end() : out;
-        temp = std::accumulate(out, outdir.end(), fs::path(), boost::bind(concat, _1, ".."));
-        return std::accumulate(file, path.end(), temp, concat);
+
+        fs::path result = fs::path();
+        for(; out != outdir.end(); ++out)
+            if(*out != ".") result /= "..";
+        std::divides<fs::path> concat;
+        return std::accumulate(file, path.end(), result, concat);
     }
 
     fs::path calculate_relative_path(