Fix #900: Store console history.txt in %APPDATA%\vkQuake on Windows#916
Open
adrian-andrzjewski wants to merge 1 commit into
Open
Fix #900: Store console history.txt in %APPDATA%\vkQuake on Windows#916adrian-andrzjewski wants to merge 1 commit into
adrian-andrzjewski wants to merge 1 commit into
Conversation
da7ece3 to
ebe33cf
Compare
On Windows, host_parms->userdir was set to host_parms->basedir (the current working directory), causing history.txt to be created in whatever directory the user launched vkQuake from. This fix adds proper user directory support on Windows, storing user data in %APPDATA%\vkQuake (matching the Unix pattern with ~/.vkquake). Changes: - Add Sys_GetUserdir() and Sys_GetUserdirArgs() to sys_sdl_win.c - Support -userdir command line override (matching Unix behavior) - Default to %APPDATA%\vkQuake for user data storage - This enables the existing userdir != basedir checks in common.c
Collaborator
|
Nevermind my previous (delete) coment, I'll redo it later differently. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows,
history.txt(console command history) is created in whatever directory the user launches vkQuake from, instead of a centralized location.Root Cause
In
sys_sdl_win.c,host_parms->userdirwas set tohost_parms->basedir(current working directory), causing user data files to be written to the launch directory.Solution
Added proper user directory support on Windows, storing user data in
%APPDATA%\vkQuake(matching the Unix pattern with~/.vkquake).Changes:
Sys_GetUserdir()andSys_GetUserdirArgs()functions tosys_sdl_win.c-userdircommand line override (matching Unix behavior)%APPDATA%\vkQuakefor user data storageuserdir != basedirchecks incommon.cTesting
Expected Behavior
history.txtstored in%APPDATA%\vkQuake\-userdiroverride available for custom paths