summaryrefslogtreecommitdiff
path: root/boost/wave/util
diff options
context:
space:
mode:
Diffstat (limited to 'boost/wave/util')
-rw-r--r--boost/wave/util/cpp_include_paths.hpp23
-rw-r--r--boost/wave/util/cpp_iterator.hpp2
-rw-r--r--boost/wave/util/flex_string.hpp2
3 files changed, 11 insertions, 16 deletions
diff --git a/boost/wave/util/cpp_include_paths.hpp b/boost/wave/util/cpp_include_paths.hpp
index d0f2fcbaa8..e5e17c8d03 100644
--- a/boost/wave/util/cpp_include_paths.hpp
+++ b/boost/wave/util/cpp_include_paths.hpp
@@ -15,6 +15,7 @@
#include <list>
#include <utility>
+#include <boost/assert.hpp>
#include <boost/wave/wave_config.hpp>
#include <boost/wave/util/filesystem_compatibility.hpp>
@@ -58,8 +59,7 @@ struct bidirectional_map
typedef std::pair<FromType, ToType> value_type;
#if defined(BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS) || \
- (defined(BOOST_MSVC) && \
- ( (BOOST_MSVC < 1300) || (BOOST_MSVC == 1600) )) || \
+ (defined(BOOST_MSVC) && (BOOST_MSVC == 1600) ) || \
(defined(BOOST_INTEL_CXX_VERSION) && \
(defined(_MSC_VER) && (BOOST_INTEL_CXX_VERSION <= 700)))
@@ -442,18 +442,13 @@ void include_paths::set_current_directory(char const *path_)
fs::path filepath (create_path(path_));
fs::path filename = util::complete_path(filepath, current_dir);
- if (fs::exists(filename) && fs::is_directory(filename)) {
- current_rel_dir.clear();
- if (!as_relative_to(filepath, current_dir, current_rel_dir))
- current_rel_dir = filepath;
- current_dir = filename;
- }
- else {
- current_rel_dir.clear();
- if (!as_relative_to(branch_path(filepath), current_dir, current_rel_dir))
- current_rel_dir = branch_path(filepath);
- current_dir = branch_path(filename);
- }
+
+ BOOST_ASSERT(!(fs::exists(filename) && fs::is_directory(filename)));
+
+ current_rel_dir.clear();
+ if (!as_relative_to(branch_path(filepath), current_dir, current_rel_dir))
+ current_rel_dir = branch_path(filepath);
+ current_dir = branch_path(filename);
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/boost/wave/util/cpp_iterator.hpp b/boost/wave/util/cpp_iterator.hpp
index 999d961908..9d61b82f2a 100644
--- a/boost/wave/util/cpp_iterator.hpp
+++ b/boost/wave/util/cpp_iterator.hpp
@@ -607,7 +607,7 @@ pp_iterator_functor<ContextT>::operator()()
break;
}
- if (whitespace.must_insert(id, act_token.get_value())) {
+ if (token_is_valid(act_token) && whitespace.must_insert(id, act_token.get_value())) {
// must insert some whitespace into the output stream to avoid adjacent
// tokens, which would form different (and wrong) tokens
whitespace.shift_tokens(T_SPACE);
diff --git a/boost/wave/util/flex_string.hpp b/boost/wave/util/flex_string.hpp
index 21c7e75fd1..73c604682c 100644
--- a/boost/wave/util/flex_string.hpp
+++ b/boost/wave/util/flex_string.hpp
@@ -1988,7 +1988,7 @@ public:
flex_string& replace(size_type pos, size_type n1, const value_type* s)
{ return replace(pos, n1, s, traits_type::length(s)); }
- // Replaces at most n1 chars of *this, starting with pos, with n2 occurences of c
+ // Replaces at most n1 chars of *this, starting with pos, with n2 occurrences of c
// consolidated with
// Replaces at most n1 chars of *this, starting with pos,
// with at most n2 chars of str.