Always write the default config if the primary config file is missing#3117
Merged
Always write the default config if the primary config file is missing#3117
Conversation
040f58a to
bf01bab
Compare
Prior to this change, if the primary config file was missing, it was created, but instead of the defaults, the current config settings were written. This included the local `dosbox.conf` if it existed and any extra configs loaded with the `--conf` CLI option on top of the actual defaults. This change ensures that whenever we create the primary config on startup, it always contains the defaults and nothing else.
bf01bab to
e5f2b5e
Compare
Member
|
Test cases nailed all the scenarios I could think of. Nice fix @johnnovak, and great catch by LiPillON 👍 |
Member
Author
|
Thanks for the review @kcgen , can you please approve it then? |
kcgen
approved these changes
Nov 14, 2023
Member
Was trying github's app on my phone.. but couldn't figure out how to review/approve. Back on the website now - and approved :-) |
Member
Author
Thanks man 😄 I found it on my phone once, I think it's under "Files changed" 😄 |
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.
Description
Fixes #3116
Prior to this change, if the primary config file was missing, it was created, but instead of the defaults, the current config settings were written. This included the local
dosbox.confif it existed and any extra configs loaded with the--confCLI option on top of the actual defaults.This change ensures that if we create the primary config on startup, it always contains the defaults and nothing else.
Manual testing
If the primary config does NOT exist in the user folder
Test 1
Test 2
--nolocalconf --conf dosbox.conf.Test 3
--machine hercules --set cycles=6666.Test 4
--noprimaryconfoption is present, regardless of the presence of the local config or any other CLI options.Test 5
dosbox-staging.confexists in the executable directory).If the primary config DOES exist in the user folder
Confirmed that it never gets recreated or overwritten in any of the above test cases.
Checklist
Please tick the items as you have addressed them. Don't remove items; leave the ones that are not applicable unchecked.
I have: