Opened 12 years ago

Closed 12 years ago

#4656 closed Bugs (invalid)

program_options parse_config_file() set iostream failbit even if the parse result is ok

Reported by: anonymous Owned by: Vladimir Prus
Milestone: To Be Determined Component: program_options
Version: Boost 1.44.0 Severity: Problem
Keywords: Cc:

Description

program_options::parse_config_file() reads data from an ifstream instance. It updates the failbit value of this stream when the file reads are ok.

Test case is attached :

$ ./foo
ios failure: failbit: 1 - badbit: 0
perror() value : test.cfg: No such file or directory
$ touch test.cfg
$ ./foo
opening test.cfg: failbit: 0 - badbit: 0
let s call parse_config_file()...
ios failure: failbit: 1 - badbit: 0
perror() value : test.cfg: Success

Attachments (2)

foo.cpp (1.3 KB ) - added by anonymous 12 years ago.
failbit.cpp (749 bytes ) - added by anonymous 12 years ago.

Download all attachments as: .zip

Change History (5)

by anonymous, 12 years ago

Attachment: foo.cpp added

comment:1 by anonymous, 12 years ago

wrong attachment. Here is the good one.

by anonymous, 12 years ago

Attachment: failbit.cpp added

comment:2 by Vladimir Prus, 12 years ago

Why is that a problem?

comment:3 by Vladimir Prus, 12 years ago

Resolution: invalid
Status: newclosed

Because I was not advised why is this a problem, I am closing this issue. Feel free to reopen should you have more details.

Note: See TracTickets for help on using tickets.