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
smallmodel
438ed2c0ea
Added a way to debug CRT heap (currently only on Windows with MSVC) 2023-08-19 02:17:45 +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
88d8d9095e Don't call Sys_SetFloatEnv in debug mode 2023-02-02 00:21:30 +01:00
L
d4faf0c0e0 Fixed compilation errors on Unix 2023-02-01 00:28:40 +01:00
L
eb4b91a22d Fixed strlen size warning 2023-01-31 01:22:58 +01:00
L
dc36511b5a Updated platform files to ioq3 codebase 2023-01-31 00:54:21 +01:00
Ley0k
563565bbf2 replaced size_t with intptr_t for negative lengths 2017-02-19 22:00:27 +01:00
Ley0k
09bed43f97 Hard reset 2016-03-27 11:49:47 +02:00