Opened 9 years ago

#9099 new Bugs

boost::filesystem::stem() reporting wrong value on some entries (seen on Linux)

Reported by: bach@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.50.0 Severity: Problem
Keywords: Cc:

Description

Compiled with gcc on Linux.

Consider the following example with an empty string as path:

  boost::filesystem::path mypath("");
  cout << mypath.parent_path().native() << endl;
  cout << mypath.stem().native() << endl;

This will print out, as expected, two empty strings. If one now changes the path to be analysed into "tmp/", like this:

  boost::filesystem::path mypath("tmp/");
  cout << mypath.parent_path().native() << endl;
  cout << mypath.stem().native() << endl;

then the output will be "tmp" on one line (totally expected and correct) and "." on the next line (totally unexpected and wrong, it should be an empty string).

Change History (0)

Note: See TracTickets for help on using tickets.