mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[quakefs] Ensure fs_sharepath and fs_userpath are never empty
Other parts of quakefs treat an empty path as an error, so fs_sharepath and fs_userpath must never be empty or they will effectively be rejected. While the user explicitly setting them to empty strings is one way for them to become empty, another is QFS_CompressPath compressing '.' to an empty path, which makes it rather difficult to set up the traditional quake directory tree (ie, operate from the current directory).
This commit is contained in:
parent
9f876390f0
commit
90447a5d3b
1 changed files with 4 additions and 0 deletions
|
@ -1436,6 +1436,10 @@ static void
|
|||
qfs_path_cvar (void *data, const cvar_t *cvar)
|
||||
{
|
||||
char *cpath = QFS_CompressPath (*(char **)data);
|
||||
if (!*cpath) {
|
||||
free (cpath);
|
||||
cpath = strdup (".");
|
||||
}
|
||||
if (strcmp (cpath, *(char **)data)) {
|
||||
free (*(char **)cvar->value.value);
|
||||
*(char **)cvar->value.value = cpath;
|
||||
|
|
Loading…
Reference in a new issue