Fix crash in "ckan available" with curly braces in mod name #2111
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.
mono ckan available
currently errors out halfway through the list:The next mod listed in
registry.json
is KSPFrenchTranslation, which has a "name" value of "KSP 1.3 Full Game French Transaltion {BETA}". Hmm, those curly braces make it look like a malformed string format parameter. Maybe someone's passing that string where a format string is expected?... Yup.
RaiseMessage
has a format/args parameter pattern, and is used that way throughout CKAN, except inCmdLine.Available.RunCommand
, where the return value of aString.Format
call is passed as the format parameter, which means trouble if any of theargs
contain curly braces:CKAN/Cmdline/Action/Available.cs
Lines 30 to 33 in 1fe5997
The attached change fixes the issue in my testing.