You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
Backport(v1.19): config: accept empty lines in quoted strings (#5448) (#5478)
<!--
Thank you for contributing to Fluentd!
Your commits need to follow DCO: https://probot.github.io/apps/dco/
And please provide the following information to help us make the most of
your pull request:
-->
**Which issue(s) this PR fixes**:
Backport #5448Fixes#4691
**What this PR does / why we need it**:
The quoted configuration values previously handled a physical line
ending together with its preceding character. When the parser was
already positioned at a line ending—such as on an empty line or after an
escaped literal backslash—it instead reported an unexpected end of file.
Handle backslash line continuations and preserved line endings
explicitly. This accepts empty lines, preserves LF and CRLF, and retains
the existing single-backslash continuation behavior.
**Docs Changes**:
None. The existing multiline-string documentation already describes the
intended behavior.
**Release Note**:
config: accept empty lines in quoted strings.
**Testing**:
Automated:
- `bundle exec rake test TEST=test/config/test_literal_parser.rb` — 220
tests, 223 assertions, 0 failures, 0 errors
- `TEST_ENV_NUMBER=focus4691 bundle exec rake test
TEST=test/config/test_config_parser.rb` — 56 tests, 106 assertions, 0
failures, 0 errors
- `bundle exec rake test` (two independent runs) — 4,343 tests, 15,829
and 15,830 assertions respectively; 0 failures, 0 errors, 3 pendings,
and 36 omissions in both
- `rubocop` — 459 files inspected, no offenses
- `ruby -c` for all three changed Ruby files and `git diff --check`
Manual (Ruby 4.0.6):
- Built and separately installed gems from baseline
`f380d996bc828b5cd488b578018c06826ebcbf7e` and candidate
`7d017869a55e179da4d195806f26d33dc485fc9d`.
- The baseline built gem rejected the reproducing configuration with a
false unexpected-EOF error; the candidate built gem accepted it with
`fluentd --dry-run`; a genuinely unterminated double-quoted value
remained rejected.
- Ran the candidate built gem as a separate `fluentd --no-supervisor`
process through `dummy` → `record_transformer` → `stdout` and externally
parsed its emitted JSON as
`{"message":"seed","blank":"world\n\n","literal_backslash":"left\\\nright","continued":"leftright"}`.
Signed-off-by: Akash Kumar <meakash7902@gmail.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Akash Kumar <91385321+AkashKumar7902@users.noreply.github.com>
Co-authored-by: Shizuo Fujita <fujita@clear-code.com>
0 commit comments