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

Backslash escaping is not handled #14

Open
dominik-korsa opened this issue Apr 18, 2022 · 1 comment
Open

Backslash escaping is not handled #14

dominik-korsa opened this issue Apr 18, 2022 · 1 comment

Comments

@dominik-korsa
Copy link

The following is snippet is from C:\Program Files (x86)\Steam\steamapps\libraryfolders.vdf:

"libraryfolders"
{
	"contentstatsid"		"4102335621006428237"
	"0"
	{
		"path"		"C:\\Program Files (x86)\\Steam"
		// ...
	}
	"1"
	{
		"path"		"D:\\SteamLibrary"
		// ...
	}
}

As you can see, there is a path key and it's value escapes the \ character. Your library parses them as
C:\\Program Files (x86)\\Steam - the backslash incorrectly appears twice
If I then do

const result = VDF.parse(/* ... */);
console.log(JSON.stringify(result.libraryfolders.0.path));

"C:\\\\Program Files (x86)\\\\Steam" gets logged

@dominik-korsa
Copy link
Author

From the docs:

Allowed Escape sequences are \n, \t, \\, and \".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant