Skip to content

fix: reset INI decoder state on init#2719

Open
xieby1 wants to merge 1 commit into
mikefarah:masterfrom
xieby1:fix/ini-decoder-reset
Open

fix: reset INI decoder state on init#2719
xieby1 wants to merge 1 commit into
mikefarah:masterfrom
xieby1:fix/ini-decoder-reset

Conversation

@xieby1
Copy link
Copy Markdown

@xieby1 xieby1 commented May 26, 2026

Generated by Hermes + GPT-5.5.

Summary

  • Reset the INI decoder's finished flag in Init
  • Add a regression test covering decoder reuse across multiple inputs

Context

eval-all reuses the same decoder instance for each input file. The INI decoder set finished = true after decoding the first input, but did not reset it in Init, so subsequent files were treated as EOF immediately.

This caused commands such as:

yq ea -p ini -o yaml '{"fi": fileIndex, "fn": filename, "doc": .}' a.ini b.ini

to only process a.ini.

Test Plan

GOPROXY=https://goproxy.cn,direct go test ./pkg/yqlib -run "TestINIDecoderInitResetsFinished|TestINIScenarios"

Also manually verified:

go run . ea -p ini -o yaml '{"fi": fileIndex, "fn": filename, "doc": .}' a.ini b.ini

now outputs both fileIndex: 0 and fileIndex: 1.

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.

1 participant