Fixing ambiguous match bug in importcarto_mem.m#91
Open
FilippoUslenghi wants to merge 2 commits into
Open
Conversation
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.
This pull request updates
importcarto_mem.min two places.First, it changes the map-name matching logic to use exact, case-insensitive string matching when identifying the selected Carto map.
Previously, map names were matched using
strstartcmpi, which could return multiple matches when another map name started with the same characters as the selected map. For example, if a study contained maps named "2-LA" and "2-LA something", selecting "2-LA" would match both entries.This would cause the following error at line 241
map.name = cartoMap.ATTRIBUTE.Name;:The change replaces
strstartcmpiwithstrcmpi, ensuring that only exact map-name matches are returned while preserving case-insensitive comparison. This keeps the behavior consistent with the intended single-match logic in lines 214-217.Second, it updates the
savecall at line 749 has been updated to use the -v7.3 MAT-file format, as in line 760.