Opened 14 years ago
Closed 13 years ago
#2425 closed Bugs (fixed)
woption_from_option missing some fields
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | Boost 1.37.0 | Component: | program_options |
Version: | Boost 1.36.0 | Severity: | Problem |
Keywords: | Cc: |
Description
As you known, woption_from_option funtion (parsers.cpp) could convert the char option to a wchar_t option. But it seems missing some fields when construct new object, such as original_tokens and unregistered.
To fix, we could add two lines for missed fields
woption woption_from_option(const option& opt) {
woption result; result.string_key = opt.string_key; result.position_key = opt.position_key;
std::transform(opt.value.begin(), opt.value.end(),
back_inserter(result.value), bind(from_utf8, _1));
Missing two fields std::transform(opt.original_tokens.begin(), opt.original_tokens.end(),
back_inserter(result.original_tokens), bind(from_utf8, _1));
result.unregistered = opt.unregistered; return result;
}
(In [53441]) Properly convert original_tokens and unregistered to woption.
Fixes #2425.