sonic2kk / steamtinkerlaunch

Linux wrapper tool for use with the Steam client for custom launch options and 3rd party programs
GNU General Public License v3.0
2.13k stars 71 forks source link

updateConfigEntry: Pass `sed` an escaped `CFGVALUE` #1076

Closed sonic2kk closed 6 months ago

sonic2kk commented 6 months ago

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 commented 6 months ago

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.