Repository navigation
BUG: Erase empty arguments in sccan before parsing - #2060
Open
hjmjohnson wants to merge 1 commit into
Open
hjmjohnson wants to merge 1 commit into
hjmjohnson wants to merge 1 commit into
Conversation
hjmjohnson
marked this pull request as ready for review
October 27, 2026 21:41
hjmjohnson
force-pushed
the
bug-sccan-erase-empty-args
branch
2 times, most recently
from
October 30, 2026 18:21
8dd587f to
9b6c623
Compare
sccan called std::remove on its arguments without erase. std::remove only moves the kept elements forward; the vector keeps its size, so argc still counted the empty strings and the parser received them. `sccan "" -h` aborted with "Unable to convert '' to type 'j'" instead of printing the help. Use the erase-remove idiom, and add sccan_EMPTY_ARGUMENT, which runs `sccan "" -h ""` and fails without the fix. Assisted-by: Claude Code - found during PR ANTsX#2056 review
hjmjohnson
force-pushed
the
bug-sccan-erase-empty-args
branch
from
October 30, 2026 19:04
9b6c623 to
b9be402
Compare
This branch has not been deployed
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.
sccanmeant to drop empty arguments, but it calledstd::removewithouterase, so the vector kept its size and the parser still received the empty strings.sccan "" -haborted withUnable to convert '' to type 'j'instead of printing the help. This uses the erase-remove idiom and adds a regression test.Testing
Inner build on macOS (AppleClang, ITK 6),
mainb463b40 plus this commit:mainsccan -hsccan "" -hsccan -h ""sccan --svd ""FileName must be specified--svdhas no value)sccan_EMPTY_ARGUMENT(sccan "" -h "", insideRUN_SHORT_TESTS): fails onmain, passes with the fix.ctest -R sccan: 3/3 pass.sccan.cxx: the same 10 before and after.git clang-format origin/main: no changes.