Modify

Ticket #4065 (closed Bugs: fixed)

Opened 4 years ago

Last modified 2 years ago

Boost Filesystem lexicographic path comparison inconsistent

Reported by: dbetz@… Owned by: bemandawes
Milestone: Boost 1.43.0 Component: filesystem
Version: Boost Development Trunk Severity: Showstopper
Keywords: filesystem, lexicographic_compare Cc:

Description

I am using boost svn number 60558. Briefly, paths "/foo/" and "/foo/." are not <, >, or ==:

#include <iostream>

#include <boost/filesystem.hpp>

int main(int argc, char *argv[]){

boost::filesystem::path p("/foo/"); boost::filesystem::path q("/foo/."); if (p<q)

std::cerr << p << " < " << q << std::endl;

else if (p==q)

std::cerr << p << " == " << q << std::endl;

else if (p>q)

std::cerr << p << " > " << q << std::endl;

else

std::cerr << p << " ? " << q << std::endl;

}

gives the following output:

/foo/ ? /foo/.

Attachments

Change History

comment:1 Changed 2 years ago by bemandawes

  • Status changed from new to closed
  • Resolution set to fixed

(In [77669]) Fix #4065, Boost Filesystem lexicographic path comparison inconsistent. The fix included adding path::compare functions, and cleanup and refactoring of the path relational operators code. Some of the code fixed is used by other functions, so some unrelated bugs may also have been fixed.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.