Merge ~dirk.zimoch/epics-base:fix_one_element_input_link_arrays into ~epics-core/epics-base/+git/epics-base:7.0

Proposed by Dirk Zimoch
Status: Merged
Approved by: Andrew Johnson
Approved revision: cc616371b16f790d4304f08ca708709b6556ec9a
Merged at revision: 68121ec907b0c0f91aec1155b0d78b5b76ec3282
Proposed branch: ~dirk.zimoch/epics-base:fix_one_element_input_link_arrays
Merge into: ~epics-core/epics-base/+git/epics-base:7.0
Diff against target: 14 lines (+1/-2)
1 file modified
modules/database/src/ioc/dbStatic/dbStaticLib.c (+1/-2)
Reviewer Review Type Date Requested Status
Andrew Johnson Approve
Review via email: mp+385269@code.launchpad.net

Commit message

Allow numeric 1 element arrays in constant input links.
Fixes bug #1882520.

Description of the change

Links like
  field (INP, [42])
or
  field (INP, [])
did not work, while
  field (INP, [42,7])
or even
  field (INP, [42,])
were fine.

Instead, they were searching for records with the name "[42]" or "[]", respectively

Now they work as expected.

To post a comment you must log in.
Revision history for this message
Andrew Johnson (anj) wrote :

This change has the potential to break existing EPICS IOC database applications.

review: Disapprove
Revision history for this message
Andrew Johnson (anj) wrote :

After further consideration I realize that the breakage I was concerned about does have some reasonable workarounds. An IOC that needs to link to records with names like [something] or even [some]:other:[thing] can still do so by appending a link flag, a field name or even just a dot to the record name in the INP/OUT link value:

  field(INP, "[something] NPP")
  field(INP, "[something].VAL")
  field(INP, "[something].")

My original concern was mainly that such records could never be the target of a link if this change were applied, but that was incorrect.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/modules/database/src/ioc/dbStatic/dbStaticLib.c b/modules/database/src/ioc/dbStatic/dbStaticLib.c
index 539ea3a..ceb4ea3 100644
--- a/modules/database/src/ioc/dbStatic/dbStaticLib.c
+++ b/modules/database/src/ioc/dbStatic/dbStaticLib.c
@@ -2330,8 +2330,7 @@ long dbParseLink(const char *str, short ftype, dbLinkInfo *pinfo)
2330 }2330 }
23312331
2332 /* Link may be an array constant */2332 /* Link may be an array constant */
2333 if (pstr[0] == '[' && pstr[len-1] == ']' &&2333 if (pstr[0] == '[' && pstr[len-1] == ']') {
2334 (strchr(pstr, ',') || strchr(pstr, '"'))) {
2335 pinfo->ltype = CONSTANT;2334 pinfo->ltype = CONSTANT;
2336 return 0;2335 return 0;
2337 }2336 }

Subscribers

People subscribed via source and target branches