Skip to content

Backslash escaping is not handled #14

Description

@dominik-korsa

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions