allow record name without .VAL in redirection

This commit is contained in:
zimoch
2011-02-04 15:31:40 +00:00
parent 382784526c
commit 04c6cb50d7

View File

@ -911,11 +911,16 @@ getFieldAddress(const char* fieldname, StreamBuffer& address)
} }
else else
{ {
// FIELD in this record // FIELD in this record or VAL in other record
char fullname[PVNAME_SZ + 1]; char fullname[PVNAME_SZ + 1];
sprintf(fullname, "%s.%s", name(), fieldname); sprintf(fullname, "%s.%s", name(), fieldname);
if (dbNameToAddr(fullname, &dbaddr) != OK)
{
// VAL in other record
sprintf(fullname, "%s.VAL", fieldname);
if (dbNameToAddr(fullname, &dbaddr) != OK) return false; if (dbNameToAddr(fullname, &dbaddr) != OK) return false;
} }
}
address.append(&dbaddr, sizeof(dbaddr)); address.append(&dbaddr, sizeof(dbaddr));
return true; return true;
} }