Repository navigation
tool_parsecfg: accept indented options and CRLF line endings again - #23499
Closed
akashdeshmukh-git wants to merge 1 commit into
Closed
akashdeshmukh-git wants to merge 1 commit into
akashdeshmukh-git wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused parser changes address both regressions with corresponding tests and no unresolved findings.
No open issues 🎉
What changed in this PR
Restores curl config-file parsing for indented options and CRLF line endings.
Changes:
- Skips leading whitespace and whitespace-only lines.
- Ends option names at any whitespace.
- Adds and registers regression tests for both cases.
| File | Description |
|---|---|
| tests/data/test3041 | Tests CRLF config lines, including a blank line and head. |
| tests/data/test3040 | Tests options indented with spaces and tabs. |
| tests/data/Makefile.am | Registers both regression tests. |
| src/tool_parsecfg.c | Restores whitespace handling in config parsing. |
Review effort: Balanced
|
Analysis of PR #23499 at 11882d9b: Test ../../tests/http/test_17_ssl_use.py::TestSSLUse::test_17_09_ssl_min_max[TLSv1.2-tlsv1-1.3] failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 2 different CI jobs (the link just goes to one of them). Generated by Testclutch |
akashdeshmukh-git
force-pushed
the
tool-parsecfg-blanks-crlf
branch
from
October 21, 2026 07:02
11882d9 to
0975af5
Compare
vszakats
reviewed
Oct 21, 2026
| <file name="%LOGDIR/test%TESTNUMBER.config"> | ||
| url = "http://%HOSTIP:%HTTPPORT/%TESTNUMBER" | ||
| header = "X-Indented: yes" | ||
| --user-agent "indented/1.0" |
Member
There was a problem hiding this comment.
Please integrate this and the other new test into an existing test case.
Since curl 8.13.0, config files with indented option lines or with CRLF line endings fail to parse: - a7fda9a moved comment handling into my_get_line() and with it the skipping of leading whitespace, so an indented option line is now parsed as an empty option name. - 1503555 made the option name end at ISBLANK() instead of ISSPACE(), so for an option without argument on a CRLF line the CR becomes part of the name, e.g. "head\r" is reported as unknown. A line with only a CR is also taken as an option name. Skip leading whitespace and ignore whitespace-only lines in parseconfig(), and end the option name at any whitespace again. Test 430 now uses indented lines in one config file and CRLF line endings in another.
akashdeshmukh-git
force-pushed
the
tool-parsecfg-blanks-crlf
branch
from
October 22, 2026 06:11
0975af5 to
66871a4
Compare
Contributor
Author
|
Folded both cases into test 430 instead. |
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since curl 8.13.0, config files with indented option lines or with CRLF line endings fail to parse:
a7fda9a moved comment handling into my_get_line() and with it the skipping of leading whitespace, so an indented option line is now parsed as an empty option name.
1503555 made the option name end at ISBLANK() instead of ISSPACE(), so for an option without argument on a CRLF line the CR becomes part of the name, e.g. "head\r" is reported as unknown. A line with only a CR is also taken as an option name.
Skip leading whitespace and ignore whitespace-only lines in parseconfig(), and end the option name at any whitespace again.
Tests 3040 and 3041 verify.