Commit graph

12 commits

Author SHA1 Message Date
Johannes Sixt
64cae0b849 Fix regular file check again.
The previous Windows fix accidentally reverted the logic of the check for
a regular file. As a consequence, ZIP files are not recognized anymore.
2017-03-19 11:38:35 +01:00
Leonardo Zide
657df22db7 Fixed Windows build. 2017-03-18 10:17:32 -07:00
Johannes Sixt
ba280bc1a7 Determine file size only of regular files.
lcDiskfile::Open() uses fopen() to open a file. On Linux, this can open
a directory just fine (at least for reading). This is slightly problematic
when it is attempted to open the parts library $(sharedir)/library.bin
and the library is an unzipped directory hierarchy. It is first attempted
to open the path as a ZIP file. While opening the directory as a file is
successful, subsequent navigation in the open "file" fails.

Pretend that a directory is an empty file so that the ZIP file reader is
not tempted to navigate around in the "file" and so reports failure in a
deterministic manner.

We could have inserted the check for regular files in lcDiskFile::Open(),
but this burdens every file open request, which can happen thousands of
times when the parts library is extracted instead of in a ZIP file.
2017-03-17 08:15:05 +01:00
leo
d5ccd6289f Include cleanup. 2016-05-02 19:13:54 +00:00
leo
9278a6fe1e Warning fixes. 2016-03-06 20:19:02 +00:00
leo
55e7cd4bab Warning fixes for VS 2015. 2016-02-16 23:11:52 +00:00
leo
4b82e75f5b Moved more file name variables to QString. 2015-02-02 06:00:42 +00:00
leo
e456b05ebf String cleanup. 2015-01-31 21:44:57 +00:00
leo
ade4b61155 Added builtin library as a zip file. 2014-09-11 19:55:34 +00:00
leo
1a29356179 Fixed potentially incorrect signed comparison. 2013-07-08 19:23:29 +00:00
leo
7a5bdf36a9 Rewrote file classes. 2012-03-22 23:44:56 +00:00
leo
4143fd0b82 Removed duplicate includes and renamed File class. 2012-03-21 01:54:03 +00:00
Renamed from common/file.cpp (Browse further)