Opened 12 years ago

Closed 12 years ago

#4751 closed Bugs (fixed)

Breaking change between 1.41 and 1.44in split

Reported by: henry_christophe@… Owned by: Pavol Droba
Milestone: Boost 1.45.0 Component: string_algo
Version: Boost 1.44.0 Severity: Showstopper
Keywords: Cc:

Description

I noticed a breaking change in the split function when the input string is empty. Consider the following example:

#include <string> #include <vector> #include <iostream> #include <boost/algorithm/string/split.hpp> #include <boost/algorithm/string/classification.hpp>

int main() {

std::vector<std::string> result; std::string empty_string; boost::algorithm::split( result,

empty_string,boost::algorithm::is_any_of( "\t" ),boost::algorithm::token_compress_off);

std::cout << "result size: " << result.size() << std::endl; return 0;

}

With boost 1.41 I get: result size: 1 With 1.44 I get: result size: 0

Meaning that splitting an empty string now has a new meaning. All I found to this subject was that 1 seems to be the correct answer (http://lists.boost.org/Archives/boost/2005/07/90266.php). Furthermore, there has been, according to the release notes, no change to string algo since the 1.41.

Change History (5)

comment:1 by Pavol Droba, 12 years ago

Status: newassigned

comment:2 by Vladimir Prus, 12 years ago

Milestone: To Be DeterminedBoost-1.45.0
Severity: RegressionShowstopper

It's not apparent to me that new behaviour is wrong. Anyway, how about looking at SVN log to determine who changed that, and talk to that person?

I'm marking this Showstopper since Eric expressed a wish to have this resolved for 1.45.

comment:3 by Pavol Droba, 12 years ago

Actually, there was one change. A small fix, that should not have such an effect. But it might be possible that the fix uncovered another problem. Anyway I will fix the issue soon. Just give me a coupe of days.

comment:4 by Pavol Droba, 12 years ago

I have just commited the fix into the trunk. But I probably cannot merge to the release now. Sorry I was not able to fix it sooner.

comment:5 by Pavol Droba, 12 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.