bugfix(worldbuilder): Add carriage return to delimiter array in loadCommandButtons tokenization#2300
Open
ViTeXFTW wants to merge 1 commit intoTheSuperHackers:mainfrom
Open
Conversation
Greptile Overview
|
| Filename | Overview |
|---|---|
| GeneralsMD/Code/Tools/WorldBuilder/src/EditParameter.cpp | Added \r to strtok delimiter to handle Windows line endings (CRLF) when parsing CommandButton.ini |
Last reviewed commit: fdbdad3
in loadCommandButton seperator Co-authored-by: AdrianeYves
03d1d5b to
fdbdad3
Compare
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.
Description
This PR fixes an issue in WorldBuilder where CommandButton validation incorrectly reports "Command button does not exist" errors when using the
Add a CommandButton to an object type. The issue occurs when CommandButton names are loaded from INI files - the names contain trailing carriage return characters from Windows line endings, causing string comparisons to fail even though the buttons exist and display correctly in the UI.This means for mappers they get a visual indication that their script has an error when the CommandButton name is correct and a false positive when the CommandButton name still has the trailing carriage return.
Root Cause
The
strtokdelimiter array inloadCommandButtons()only included" ,\t\n"Fix in
EditParameter.cpp. In loadCommandButtons(): added\rto the delimiter.Old:

New:
