Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68656 - branches/quickbook-filenames/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2011-02-05 10:42:30


Author: danieljames
Date: 2011-02-05 10:42:29 EST (Sat, 05 Feb 2011)
New Revision: 68656
URL: http://svn.boost.org/trac/boost/changeset/68656

Log:
Partial fix for portable path detection.

`portable_posix_name` is for checking names not paths. So instead just
warn if the path contains a `\` which is close enough. Should really be
using URLs. Maybe converting `\` to `/` (with a warning) for backwards
compatability.
Text files modified:
   branches/quickbook-filenames/tools/quickbook/src/actions.cpp | 8 ++++----
   1 files changed, 4 insertions(+), 4 deletions(-)

Modified: branches/quickbook-filenames/tools/quickbook/src/actions.cpp
==============================================================================
--- branches/quickbook-filenames/tools/quickbook/src/actions.cpp (original)
+++ branches/quickbook-filenames/tools/quickbook/src/actions.cpp 2011-02-05 10:42:29 EST (Sat, 05 Feb 2011)
@@ -517,7 +517,7 @@
     {
         if(!actions.output_pre(phrase)) return;
 
- if(!fs::portable_posix_name(image_fileref))
+ if(image_fileref.find('\\') != std::string::npos)
         {
             detail::outwarn(actions.filename, first.get_position().line)
                 << "Image path isn't portable: "
@@ -1343,7 +1343,7 @@
     {
         std::string path_text(first, last);
 
- if(!fs::portable_posix_name(path_text))
+ if(path_text.find('\\') != std::string::npos)
         {
             detail::outwarn(actions.filename, first.get_position().line)
                 << "Path isn't portable: "
@@ -1360,7 +1360,7 @@
         // path to the source file relative to the output directory.
 
         fs::path path = detail::generic_to_path(name);
- if (!path.has_root_directory())
+ if (!path.has_root_directory() && !path.has_root_name())
         {
             fs::path infile = fs::absolute(actions.filename).normalize();
             path = (infile.parent_path() / path).normalize();
@@ -1387,7 +1387,7 @@
             fs::path path(name);
 
             // If the path is relative, try and resolve it.
- if (!path.has_root_directory())
+ if (!path.has_root_directory() && !path.has_root_name())
             {
                 // See if it can be found locally first.
                 if (fs::exists(current / path))


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk