-#if defined(__WIN32__) || defined(_WIN32) || defined(_WIN64)
- boost::replace_all(path, "/", "\\");
+ ASSERT(!onePath.empty() && "empty search path string");
+
+ // add a slash if there isn't one already
+ if (*onePath.rbegin() != '/')
+ {
+ onePath += '/';
+ }
+
+#if defined(_WIN32) || defined(__WIN32__)
+ boost::replace_all(onePath, "/", "\\");