Skip to content

config: support backslash-newline line continuation (#611) - #625

Open
Mobeen0119 wants to merge 1 commit into
Limine-Bootloader:trunkfrom
Mobeen0119:fix-611-trunk
Open

config: support backslash-newline line continuation (#611)#625
Mobeen0119 wants to merge 1 commit into
Limine-Bootloader:trunkfrom
Mobeen0119:fix-611-trunk

Conversation

@Mobeen0119

Copy link
Copy Markdown

Add backslash-newline line continuation to config parser.

O(n) two-pointer approach.
Handles Unix (\n) and Windows (\r\n) line endings.

Example:
CMDLINE: root=/dev/sda1 rw quiet
zswap.enabled=0

Becomes one continuous line.

Tested with 20 unit tests + 100K fuzz + 50K comparisons vs old code.

Fixes #611

Test Files :
test_compare.c
test_full.c

@programmerlexi

Copy link
Copy Markdown
Contributor

This is the third time you have created this PR. Can you please just amend/rebase new changes and force push them instead of recreating the PR everytime?

@CherrieTheShifter

Copy link
Copy Markdown

Yes This Please 🙏

@Zesko

Zesko commented Aug 23, 2026

Copy link
Copy Markdown

I would suggest improving performance when limine.conf contains many lines.

It should skip lines that don't contain kernel command lines instead of checking every single line.
Otherwise, checking all lines can unnecessarily increase boot time on large configurations.

@Mobeen0119

Copy link
Copy Markdown
Author

This pipeline already runs multiple full-buffer passes before mine (hash check, continuation-collapse, whitespace trim, macro load, macro expand), so mine isn't adding a new category of cost and skipping non-cmdline lines isn't possible at this point since nothing's tokenized into lines yet. Worth noticing: the whitespace-trim loop right after mine is actually O(n²), not O(n) ... it shifts the entire remaining buffer on every skip event, which is the bigger perf risk on large configs, and it's pre-existing.

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.

4 participants