Option values that mirrored the wrong thing at exit 0 - #1436
Merged
Conversation
--structure=on expanded to a bare -N, which reads the next word as a user template: the URL was swallowed and the run mirrored nothing. "on" now names the default preset (-N0), like "off" already did. --long-names= expanded to a bare -L, whose sscanf converted nothing and left the switch to re-map the value already stored, so it selected DOS 8.3 names -- and -L1 -L did too. A bare -L now selects L1, the option's own starred default. Closes #1434 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
The bound #1418 introduced counts digits, so a zero-padded run falls off it: -L0000000001 selected ISO9660 where -L1 selects long names, -N0000000001 lost its preset, and --structure=0000000001 was refused outright. optalias_digits_fit skips the leading zeros before applying the bound, and the four sites that read such a run share it. Test 368 gains the padded spellings, and its template case now carries a literal tpl/ marker: %h%p/%n%q.%t is the default layout for a file:// URL, so it passed even with --structure back on the pre-#1418 "param" class. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
xroche
enabled auto-merge (squash)
August 25, 2026 08:35
xroche
added a commit
that referenced
this pull request
Aug 25, 2026
The 16-character cap was doing two jobs. Dropping it let a long padded run
reach the 1024-byte expansion buffer, where strlcatbuff aborts: --depth with
1022 zeros exited 134 with a backtrace where master printed a syntax error.
Bound the value against the room the short form leaves, at the glue site, which
also covers the param0 rows that abort on master today (--allow, 1023 chars).
optalias_suffix() carried a copy of the same bare 16, so --generate-errors=
3000000000 still reached sscanf("%d") as -1294967296; it now takes the same
magnitude bound. Also: the errno != ERANGE idiom the tree already spells, LLint
over int64_t, and mirror_names/mirror_has_name shared with 362.
The PR body's claim about #1436 was wrong: optalias_digits_fit() is on that
branch, not in the tree, so --structure=0000000001 is refused here too.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
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.
Two of the three spellings in #1434 mirrored the wrong thing at exit 0, both because the value mapped onto the bare short form.
--structure=onexpanded to a bare-N, which reads the next word as a user template, so--structure=on <URL>swallowed the URL and mirrored nothing. "on" now names the default preset (-N0), the layout "off" already selected; #1418's glue rules are otherwise untouched.--long-names=expanded to a bare-L, whosesscanfconverted nothing and left the switch to re-map the value already stored, landing on DOS 8.3 names (-L1 -Ldid the same). Rather than refuse the empty value I fixed the short form: a bare-Lnow selects L1, the default the help and man page already star. Refusing would have takensockets=and the config-filelong-names=spelling with it, and this way the empty value means the option's own default.-L0,--long-names=offand--long-names=2are unchanged.Rewriting that parse surfaced a third bug, pre-existing and folded in here: the digit-run bound #1418 added counts digits rather than reading the value, so a zero-padded run falls off it.
-L0000000001selected ISO9660,-N0000000001lost its preset, and--structure=0000000001was refused.optalias_digits_fitskips the leading zeros first, shared by the four sites that read such a run.The 27
paramrows keep #1427's 16-character cap: its bound is a magnitude, not a run length, sooptalias_digits_fitdoes not fit there — 9 significant digits would refuse--advanced-maxlinks=2000000000, and it cannot see the second operand of-m N,N2. Filed as #1437.The third spelling in the issue,
--structure=I0, has been refused since #1418 landed after the issue was measured, and test 368 pins that. What survives is--structure=8I0: the digits-then-cluster form #1418 glues on purpose, and the same shape as the--structure=1L0that #1427's test pins as accepted. No rule separates the two, so that one wants a decision rather than a patch.Closes #1434