Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updateConfigEntry: Pass sed an escaped CFGVALUE #1076

Merged
merged 4 commits into from
Mar 25, 2024

Conversation

sonic2kk
Copy link
Owner

Work for #1072.

sed will expand escape sequences in strings, so give it an escaped version of the CFGVALUE string to make updating existing config value items with backslashes work without expanding them. For example, sed would escape the following string, removing all backslashes and expanding the \t to be a tab character: Z:\home\gaben\testgames.

Should fix updating blank config entry items to have new values with backslashes in them. For example, updating a blank CUSTOMCMD_ARGS to have CUSTOMCMD_ARGS="Z:\home\gaben\testgames".

@sonic2kk sonic2kk changed the title updateConfigEntry: Pass sed an escaped CFGVALUE updateConfigEntry: Pass sed an escaped CFGVALUE Mar 24, 2024
@sonic2kk sonic2kk marked this pull request as draft March 24, 2024 04:09
@sonic2kk sonic2kk marked this pull request as ready for review March 24, 2024 04:37
sed will expand escape sequences in strings,
so give it an escaped version of the
CFGVALUE string to make updating existing
config value items with backslashes work
without expanding them.
Need to move it until after we map CFGVALUE booleans
so that ESCAPED_CFGVALUE contains the final updated
CFGVALUE.
@sonic2kk sonic2kk force-pushed the updateConfigEntry-escape-incoming-cfgvalue branch from 075396d to 61bb84b Compare March 24, 2024 21:29
@sonic2kk sonic2kk linked an issue Mar 24, 2024 that may be closed by this pull request
@sonic2kk
Copy link
Owner Author

Tested by me and by @zany130 in #1072, works as expected and does not appear to introduce any regressions to saving with existing config files as well as with fresh config files. This should be ready to merge.

@sonic2kk sonic2kk merged commit bad7466 into master Mar 25, 2024
1 check passed
@sonic2kk sonic2kk deleted the updateConfigEntry-escape-incoming-cfgvalue branch March 31, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to pass windows paths to custom commands
1 participant