Skip to content

Commit 43cc2af

Browse files
committed
Merge branch 'master' into develop
2 parents 0414abe + bc0c90a commit 43cc2af

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

include/boost/program_options/errors.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ namespace boost { namespace program_options {
110110
std::map<std::string, string_pair > m_substitution_defaults;
111111

112112
public:
113-
/** template with placeholders */
114-
std::string m_error_template;
113+
/** template with placeholders */
114+
std::string m_error_template;
115115

116-
error_with_option_name(const std::string& template_,
117-
const std::string& option_name = "",
118-
const std::string& original_token = "",
119-
int option_style = 0);
116+
error_with_option_name(const std::string& template_,
117+
const std::string& option_name = "",
118+
const std::string& original_token = "",
119+
int option_style = 0);
120120

121121
/** gcc says that throw specification on dtor is loosened
122122
* without this line

src/parsers.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,16 @@ namespace boost { namespace program_options {
153153
{
154154
boost::throw_exception(reading_file(filename));
155155
}
156-
return parse_config_file(strm, desc, allow_unregistered);
156+
157+
basic_parsed_options<charT> result
158+
= parse_config_file(strm, desc, allow_unregistered);
159+
160+
if (strm.bad())
161+
{
162+
boost::throw_exception(reading_file(filename));
163+
}
164+
165+
return result;
157166
}
158167

159168
template

test/exception_txt_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void test_invalid_option_value_exception_msg()
152152
{
153153
options_description desc;
154154
desc.add_options()
155-
("int-option,d", value< int >(), "An option taking an integer")
155+
("int-option,d", value< int >(), "An option taking an integer")
156156
;
157157

158158
vector<vector<const char*> > argv;
@@ -308,7 +308,7 @@ void test_invalid_bool_value_exception_msg()
308308
{
309309
options_description desc;
310310
desc.add_options()
311-
("bool_option,b", value< bool>(), "bool_option")
311+
("bool_option,b", value< bool>(), "bool_option")
312312
;
313313

314314

0 commit comments

Comments
 (0)