Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table tool type name matching #62

Closed
jphickey opened this issue Nov 7, 2023 · 0 comments · Fixed by #63
Closed

Table tool type name matching #62

jphickey opened this issue Nov 7, 2023 · 0 comments · Fixed by #63
Assignees
Labels
bug Something isn't working

Comments

@jphickey
Copy link
Contributor

jphickey commented Nov 7, 2023

Describe the bug
There is a substring matching bug when EDS datasheet using a substring match of the table name with the EDS app and type name.

Specifically, this uses strncasecmp() to match the app name first, as a prefix to the type name. The problem is that it doesn't check that the following char is a separator, thus app names that are a substring of one another become ambiguous and can be incorrectly matched.

For example - the identifier "SCH_LAB_ScheduleTable_t' may match the datasheet for "SC" because SC is a substring of SCH_LAB.

To Reproduce
Generate tables in a configuration containing both SC and SCH_LAB apps. The tables for SCH_LAB may get incorrectly associated with SC datasheet and fail to build as a result.

Expected behavior
Should not match SCH to SC.

System observed on:
Debian

Additional context
As a simple fix, just confirm that the next char is a separator (e.g. _ or end-of-string) which will avoid matching SC to SCH_LAB.

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Nov 7, 2023
@jphickey jphickey added the bug Something isn't working label Nov 7, 2023
jphickey added a commit to jphickey/EdsLib that referenced this issue Nov 7, 2023
Confirm that the next char in the name match is a separator before breaking
out of the loop.  This avoids matching on a prefix, such as SC to SCH_LAB.
jphickey added a commit to jphickey/EdsLib that referenced this issue Nov 7, 2023
Confirm that the next char in the name match is a separator before breaking
out of the loop.  This avoids matching on a prefix, such as SC to SCH_LAB.
jphickey added a commit to jphickey/EdsLib that referenced this issue Nov 7, 2023
Confirm that the next char in the name match is a separator before breaking
out of the loop.  This avoids matching on a prefix, such as SC to SCH_LAB.
jphickey added a commit that referenced this issue Nov 16, 2023
Fix #62, correct name match in table build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant