diff --git a/pvtoolsSrc/pvput.cpp b/pvtoolsSrc/pvput.cpp index 9efe813..00c95ea 100644 --- a/pvtoolsSrc/pvput.cpp +++ b/pvtoolsSrc/pvput.cpp @@ -106,22 +106,33 @@ struct Putter : public pvac::ClientChannel::PutCallback typedef std::vector pairs_t; pairs_t pairs; - for(size_t i=0, N=values.size(); igetSubField(fname)); + if(fld) { + // The "field" exist. Treat this input as a filed=value pair. + pairs.push_back(std::make_pair(fname, values[i].substr(sep+1))); + } else { + // If the "field" does not exist, this could be a bare value containing a "=" char. + // The ".value" field must exist and be of type "string". Otherwise, the field was + // incorrect and we ignore it. + pvd::PVFieldPtr fldv(root->getSubFieldT("value")); + if (fldv) { + if ((pvd::scalar==fldv->getField()->getType()) && (0==fldv->getField()->getID().compare("string"))) + // Tread it as a bare value + bare.push_back(values[i]); + else + // Ignore it + fprintf(stderr, "%s : Warning: no such field. Ignoring it.\n", fname.c_str()); + } + } } }