Repository navigation
tool_parsecfg: count skipped lines in config file line numbers - #23600
Closed
trestoncuzzort wants to merge 1 commit into
Closed
trestoncuzzort wants to merge 1 commit into
trestoncuzzort wants to merge 1 commit into
Conversation
Since curl 8.13.0, warnings and errors for config files show the wrong line number when comments or blank lines come before the option. a7fda9a moved the skipping of those lines into my_get_line(), and parseconfig() only counts the lines it gets back, so an option on line 4 after two comments and a blank line is reported as line 1. Let my_get_line() count every line it reads, including the skipped ones, when the caller passes a counter. The other callers pass NULL. Test 466 checks the line number in a warning after comment lines. Follow-up to a7fda9a curl#16590
|
Analysis of PR #23600 at 939ebcf5: Test ../../tests/http/test_02_download.py::TestDownload::test_02_06_download_many_parallel[h3] failed, but it has been 0.4% flaky lately, so it's probably NOT a fault of the PR. Note that this test has failed in 2 different CI jobs (the link just goes to one of them). Generated by Testclutch |
There was a problem hiding this comment.
🟢 Approval recommended
The focused fix counts skipped lines correctly, updates callers consistently, and includes regression coverage for the reported defect.
No open issues 🎉
What changed in this PR
Fixes config-file diagnostic line numbers so they include skipped comments and blank lines.
Changes:
- Adds an optional line counter to
my_get_line()and uses it inparseconfig(). - Updates other callers to pass
NULL, preserving their behavior. - Adds and registers a regression test for warnings after skipped lines.
| File | Description |
|---|---|
| tests/data/test466 | Verifies the warning reports line 4 after comments and a blank line. |
| tests/data/Makefile.am | Registers test 466. |
| src/tool_ssls.c | Passes NULL for the unused line counter. |
| src/tool_parsecfg.h | Declares the optional line-counter parameter. |
| src/tool_parsecfg.c | Counts every successfully read line, including skipped lines. |
| src/tool_getparam.c | Updates URL and header readers for the new signature. |
| src/tool_formparse.c | Updates the form-header reader for the new signature. |
Review effort: Balanced
bagder
approved these changes
Oct 26, 2026
Member
|
Thanks! |
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Oct 26, 2026
Follow-up to 2d4493d curl#23600
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 8.13.0 the line numbers in config file warnings and errors leave out comment and blank lines. a7fda9a moved skipping those into
my_get_line(), andparseconfig()only counts the lines it gets back.The option is on line 4. With this change
my_get_line()counts every line it reads when the caller passes a counter, andparseconfig()passes one. The other callers pass NULL.Test 466 is test 459 with comment and blank lines first. It fails on master and passes with the fix. Locally the full test suite passes (1757 tests run) and checksrc is clean.