Skip to content

allow quotes in conf values - #19218

Open
Jamiras wants to merge 7 commits into
libretro:masterfrom
Jamiras:bugfix/conf_quotes
Open

allow quotes in conf values#19218
Jamiras wants to merge 7 commits into
libretro:masterfrom
Jamiras:bugfix/conf_quotes

Conversation

@Jamiras

@Jamiras Jamiras commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

Any string written to retroarch.cfg containing double quotes will now explicitly escape the double quote. Other characters are not escaped to prevent breaking of things like paths. When reading the config file, a \" pair will be converted to ". Any other backslashes will be treated as single characters.

Before:

cheevos_password = "it's a "secret"."

Would be loaded as it's a .

Now, it will be written as:

cheevos_password = "it's a \"secret\"."

Which will retrieve the full it's a "secret"..

Other instances of backslashes are not escaped.

rgui_browser_directory = "C:\Games\ROMs"

Related Issues

Fixes #15848

Related Pull Requests

n/a

Reviewers

[If possible @mention all the people that should review your pull request]

@RobLoach

RobLoach commented Aug 9, 2026

Copy link
Copy Markdown
Member

Small tweak in Jamiras#10

@Jamiras

Jamiras commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback.

I've modified config_file_strip_comment to handle escaped quoted values. Tested with:

"se\"cret#1"

and

"This is a \"Secret #word#\"" # ignore this

And incorporated a modified version of your solution to ignore the last escaped quote if no further quotes exist.

@RobLoach RobLoach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid.

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.

Special characters on retroarch.cfg cheevos_password aren't properly escaped.

2 participants