Commit graph

12 commits

Author SHA1 Message Date
pryon
6b91846b0c Reimplement Sys_ListFiles and Sys_ListFilteredFiles
They had several bugs, like showing the current and parent directory entires twice, not seeing files but only directories, etc.
2024-09-21 19:36:13 +02:00
smallmodel
205709271b
Add fixes from upstream ioq3 2024-09-19 19:24:31 +02:00
Sébastien Noel
a010e648ee Fix a few typos 2024-09-19 10:52:47 +02:00
Alan Zhao
769d06b0f0
Use nanosleep(2) instead of usleep(3)
usleep(3) was declared obsolete in POSIX.1-2001 and removed in
POSIX.1-2008 and nanosleep(2) was recommended to be used instead.
2024-07-26 23:03:09 +02:00
smallmodel
34ea099d87
Define _FILE_OFFSET_BITS to 64 due to a bug in readdir() affecting 32-bit architectures
readdir() would return NULL, setting errno to EOVERFLOW, unable to load pk3 files
2024-06-06 22:18:23 +02:00
Zack Middleton
9c0d66c9f2
Don't list mod directories at Windows drive root
The mod list on Windows would search the root of the drive if
fs_basepath, fs_homepath, fs_steampath, or fs_gogpath are blank ("")
(which is usually the case).

The issue is in the low-level Sys_ListFiles() but it only affects the
mod menu, on Windows. It cannot be abused by console commands to
list system files outside of the virtual filesystem.

---

If a directory at the root of the drive of the working directory
contained a pk3 file, the directory was listed in the mods menu. The
virtual filesystem doesn't add blank directory names to the search path
so it cannot load mods from the drive root. (Unless of course you set a
fs_*path cvar to "C:\".)

Sys_ListFiles() with blank directory caused Windows to use "\*" for the
search path and "\" prefix means root of drive. Unix opendir("") failed
so nothing was listed for blank directory.

Sys_ListFilteredFiles() with blank directory _and_ specifying subdirs
could access any directory (on Windows and Unix-like) but no code uses
this or makes it accessible.

These functions are only used for initializing the virtual filesystem
and listing mods. They are not accessible by anything else such as a
console command. Only the mods menu, on Windows, is affected.
2023-07-06 19:46:01 +02:00
OM
24cf12dd36 Fixed Linux compilation errors 2023-05-28 22:54:19 +02:00
OM
ca3340b158 ioquake3 porting 2023-05-24 19:29:36 +02:00
L
08f151c665 Fixed ARM compilation 2023-02-01 22:45:04 +01:00
L
d4faf0c0e0 Fixed compilation errors on Unix 2023-02-01 00:28:40 +01:00
L
dc36511b5a Updated platform files to ioq3 codebase 2023-01-31 00:54:21 +01:00
Ley0k
09bed43f97 Hard reset 2016-03-27 11:49:47 +02:00