diff -dur boost_1_43_0.orig/libs/program_options/src/options_description.cpp boost_1_43_0/libs/program_options/src/options_description.cpp
|
old
|
new
|
|
| 305 | 305 | bool long_ignore_case, |
| 306 | 306 | bool short_ignore_case) const |
| 307 | 307 | { |
| 308 | | shared_ptr<option_description> found; |
| | 308 | shared_ptr<option_description> found_approx; |
| | 309 | shared_ptr<option_description> found_full; |
| 309 | 310 | vector<string> approximate_matches; |
| 310 | 311 | vector<string> full_matches; |
| 311 | 312 | |
| … |
… |
|
| 323 | 324 | if (r == option_description::full_match) |
| 324 | 325 | { |
| 325 | 326 | full_matches.push_back(m_options[i]->key(name)); |
| | 327 | found_full = m_options[i]; |
| 326 | 328 | } |
| 327 | 329 | else |
| 328 | 330 | { |
| 329 | 331 | // FIXME: the use of 'key' here might not |
| 330 | 332 | // be the best approach. |
| 331 | 333 | approximate_matches.push_back(m_options[i]->key(name)); |
| | 334 | found_approx = m_options[i]; |
| 332 | 335 | } |
| 333 | | |
| 334 | | found = m_options[i]; |
| 335 | 336 | } |
| 336 | 337 | if (full_matches.size() > 1) |
| 337 | 338 | boost::throw_exception( |
| … |
… |
|
| 346 | 347 | boost::throw_exception( |
| 347 | 348 | ambiguous_option(name, approximate_matches)); |
| 348 | 349 | |
| 349 | | return found.get(); |
| | 350 | if (!full_matches.empty()) |
| | 351 | return found_full.get(); |
| | 352 | return found_approx.get(); |
| 350 | 353 | } |
| 351 | 354 | |
| 352 | 355 | BOOST_PROGRAM_OPTIONS_DECL |