Skip to content

Fix parsing of quoted keys#18

Merged
skalahonza merged 1 commit intoskalahonza:masterfrom
dhrdlicka:feature/fix-quoted-keys
Jul 7, 2025
Merged

Fix parsing of quoted keys#18
skalahonza merged 1 commit intoskalahonza:masterfrom
dhrdlicka:feature/fix-quoted-keys

Conversation

@dhrdlicka
Copy link
Contributor

@dhrdlicka dhrdlicka commented Jun 27, 2025

Goal

Closes #19

Background

Some INF files use keys with quote characters, e.g. InfHelperTests/infs/oem160.inf:

"Realtek High Definition Audio" = IntcAzAudModel, HDAUDIO\FUNC_01&VEN_10EC&DEV_0257&SUBSYS_17AA39F5 ; ThinkBook 16p NX ARH

Under the current implementation, the parser incorrectly parses the key as a value, ending up with a Key object like this:

[null] = {"\"Realtek High Definition Audio\"", "=IntcAzAudModel", "HDAUDIO\FUNC_01&VEN_10EC&DEV_0257&SUBSYS_17AA39F5"}

Implementation

I added a check to the closing quote handler, which returns to key ID parsing if the currently processed key does not have one yet. I also made sure the key parsing is finished upon encountering a quoted value terminated by a newline (#16)

Testing

I added a new QuotedKeyParsingTest test that checks for this.

@skalahonza
Copy link
Owner

@dhrdlicka thank you for your contribution
I will merge this PR and draft a new nuget release in no time

@skalahonza skalahonza merged commit 8806567 into skalahonza:master Jul 7, 2025
1 check passed
@skalahonza
Copy link
Owner

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.

Keys in quote marks are not parsed correctly

2 participants