Merge ~dirk.zimoch/epics-base:fix_one_element_input_link_arrays into 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-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
1diff --git a/modules/database/src/ioc/dbStatic/dbStaticLib.c b/modules/database/src/ioc/dbStatic/dbStaticLib.c
2index 539ea3a..ceb4ea3 100644
3--- a/modules/database/src/ioc/dbStatic/dbStaticLib.c
4+++ b/modules/database/src/ioc/dbStatic/dbStaticLib.c
5@@ -2330,8 +2330,7 @@ long dbParseLink(const char *str, short ftype, dbLinkInfo *pinfo)
6 }
7
8 /* Link may be an array constant */
9- if (pstr[0] == '[' && pstr[len-1] == ']' &&
10- (strchr(pstr, ',') || strchr(pstr, '"'))) {
11+ if (pstr[0] == '[' && pstr[len-1] == ']') {
12 pinfo->ltype = CONSTANT;
13 return 0;
14 }

Subscribers

People subscribed via source and target branches