dbStatic: fix CONSTANT links
constantStr==NULL and constantStr=="" have different
meanings for recGblInitConstantLink() which is used with DOL.
constantStr should remain NULL unless explicitly set
by either initial("") or field(..., "")
This commit is contained in:
@@ -1915,7 +1915,8 @@ long dbInitRecordLinks(dbRecordType *rtyp, struct dbCommon *prec)
|
||||
plink->type = CONSTANT;
|
||||
|
||||
switch (plink->type) {
|
||||
case CONSTANT: plink->value.constantStr = callocMustSucceed(1, 1, "init CONSTANT link"); break;
|
||||
/* constantStr is allowed to remain NULL if plink->text==NULL */
|
||||
case CONSTANT: plink->value.constantStr = NULL; break;
|
||||
case PV_LINK: plink->value.pv_link.pvname = callocMustSucceed(1, 1, "init PV_LINK"); break;
|
||||
case VME_IO: plink->value.vmeio.parm = pNullString; break;
|
||||
case CAMAC_IO: plink->value.camacio.parm = pNullString; break;
|
||||
|
||||
@@ -270,9 +270,9 @@ long dbAllocRecord(DBENTRY *pdbentry,const char *precordName)
|
||||
|
||||
plink->type = CONSTANT;
|
||||
if(pflddes->initial) {
|
||||
plink->value.constantStr =
|
||||
plink->text =
|
||||
dbCalloc(strlen(pflddes->initial)+1,sizeof(char));
|
||||
strcpy(plink->value.constantStr,pflddes->initial);
|
||||
strcpy(plink->text,pflddes->initial);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user