| View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||
| 0015890 | CMake | CMake | public | 2015-12-21 10:43 | 2016-05-02 08:30 | ||||
| Reporter | Fredrik Björkenfors | ||||||||
| Assigned To | Clinton Stimpson | ||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||
| Status | closed | Resolution | fixed | ||||||
| Platform | Windows | OS | Windows 7 | OS Version | Win7 SP1 | ||||
| Product Version | CMake 3.4 | ||||||||
| Target Version | CMake 3.5 | Fixed in Version | CMake 3.5 | ||||||
| Summary | 0015890: file(STRINGS ..) doesn't work on single character files. | ||||||||
| Description | If the file passed to file(STRINGS <file> VAR) contains a single character file VAR will be empty. | ||||||||
| Steps To Reproduce | Run CMake on the attached project. Workaround: Adding any character to the input file, including an EOL character. | ||||||||
| Additional Information | If the file has less than 2 characters ReadBOM(std::istream& in) will set the failbit and the attempt to rewind the file will fail. | ||||||||
| Tags | No tags attached. | ||||||||
| Attached Files | |||||||||
| Relationships | |
| Relationships |
| Notes | |
|
(0040014) Brad King (manager) 2015-12-21 10:47 |
Thanks. This was likely introduced as of CMake 3.2 with this change: file: Teach STRINGS to support UTF-16 and UTF-32 encodings https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1f77a700 [^] |
|
(0040015) Brad King (manager) 2015-12-21 10:52 |
The bug itself may be in the KWSys FStream::ReadBOM implementation introduced here: FStream: Add ability to detect BOM. http://public.kitware.com/gitweb?p=KWSys.git;a=commitdiff;h=b3b20cc0 [^] |
|
(0040017) Fredrik Björkenfors (reporter) 2015-12-21 11:00 |
Yes, this is were the rewind fails due to in.read setting the failbit. I think seekg clears the eofbit, but not the failbit. in.read(reinterpret_cast<char*>(bom), 2); + if(!in.good()) + { + in.seekg(orig); + return BOM_None; + } |
|
(0040032) Clinton Stimpson (developer) 2016-01-01 00:43 |
Here is a candidate fix. http://review.source.kitware.com/#/c/20612/ [^] |
|
(0040152) Brad King (manager) 2016-01-07 16:07 |
The KWSys change referenced in 0015890:0040032 has been merged to upstream KWSys. Here is a commit to CMake to update it: KWSys 2016-01-07 (2418443e) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f2b0bf6e [^] |
|
(0040995) Robert Maynard (manager) 2016-05-02 08:30 |
Closing resolved issues that have not been updated in more than 4 months. |
| Notes |
| Issue History | |||
| Date Modified | Username | Field | Change |
| 2015-12-21 10:43 | Fredrik Björkenfors | New Issue | |
| 2015-12-21 10:43 | Fredrik Björkenfors | File Added: CMake_bug.zip | |
| 2015-12-21 10:47 | Brad King | Note Added: 0040014 | |
| 2015-12-21 10:52 | Brad King | Note Added: 0040015 | |
| 2015-12-21 10:52 | Brad King | Assigned To | => Clinton Stimpson |
| 2015-12-21 10:52 | Brad King | Status | new => assigned |
| 2015-12-21 10:52 | Brad King | Target Version | => CMake 3.5 |
| 2015-12-21 11:00 | Fredrik Björkenfors | Note Added: 0040017 | |
| 2016-01-01 00:43 | Clinton Stimpson | Note Added: 0040032 | |
| 2016-01-07 16:07 | Brad King | Note Added: 0040152 | |
| 2016-01-07 16:07 | Brad King | Status | assigned => resolved |
| 2016-01-07 16:07 | Brad King | Resolution | open => fixed |
| 2016-01-07 16:07 | Brad King | Fixed in Version | => CMake 3.5 |
| 2016-05-02 08:30 | Robert Maynard | Note Added: 0040995 | |
| 2016-05-02 08:30 | Robert Maynard | Status | resolved => closed |
| Issue History |
| Copyright © 2000 - 2018 MantisBT Team |