Bug 97293
Summary: | Subsequent ifstream open fails for short files with no end-of-line (EOL) | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Arthur Person <person> |
Component: | gcc3 | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED NOTABUG | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 9 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i686 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2003-06-17 16:04:42 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Arthur Person
2003-06-12 18:31:16 UTC
I've discovered that adding in2.clear() immediately before in2.open apparently clears error bits and allows the code to work. That's what you should do. This behaviour is mandated by ISO C++98. Okay, I see what's happening now. Clearing status before open is a wierd requirement. I would have expected that when a file is closed that status would be reset to default values. I haven't seen any examples that use clear() before open(), but I'm not real experienced at c++ either. Thanks for pointing this out. |