[filesystem]: bug and patch in path_posix_windows.cpp

There are lots of "#ifdef BOOST_WINDOWS ... #endif" blocks wrapping code to handle the ':' in libs/filesystem/path_posix_windows.cpp. In one place only is the preprocessor block missing, which I believe is a bug. Patch attached. Silly test case. Without the patch, this: #include <boost/filesystem/path.hpp> #include <iostream> #include <string> namespace fs = boost::filesystem; int main() { std::string const PATH="/usr/local/bin:/usr/bin:/bin"; fs::path const path(PATH, fs::no_check); std::cout << PATH << '\n' << path.native_file_string() << std::endl; return 0; } Produces /usr/local/bin:/usr/bin:/bin /usr/local/bin:usr/bin:bin under *nix. Regards, Angus

At 11:26 AM 9/14/2004, Angus Leeming wrote:
There are lots of "#ifdef BOOST_WINDOWS ... #endif" blocks wrapping code to handle the ':' in libs/filesystem/path_posix_windows.cpp. In one place only is the preprocessor block missing, which I believe is a bug. Patch attached.
Silly test case. Without the patch, this:
#include <boost/filesystem/path.hpp> #include <iostream> #include <string>
namespace fs = boost::filesystem;
int main() { std::string const PATH="/usr/local/bin:/usr/bin:/bin"; fs::path const path(PATH, fs::no_check); std::cout << PATH << '\n' << path.native_file_string() << std::endl; return 0; }
Produces /usr/local/bin:/usr/bin:/bin /usr/local/bin:usr/bin:bin under *nix.
Thanks for spotting this. I've added the test case to path_test.cpp, and applied the patch to fix the problem. --Beman
participants (2)
-
Angus Leeming
-
Beman Dawes