Modify

Ticket #2425 (closed Bugs: fixed)

Opened 5 years ago

Last modified 5 years ago

woption_from_option missing some fields

Reported by: flier.lu@… 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;

}

Attachments

Change History

comment:1 Changed 5 years ago by vladimir_prus

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

(In [53441]) Properly convert original_tokens and unregistered to woption.

Fixes #2425.

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.