From 546de6fe327e2ed9c6e7fe99f1218187048a08f7 Mon Sep 17 00:00:00 2001 From: Jesus Vasquez Date: Mon, 8 Mar 2021 15:21:58 -0800 Subject: [PATCH] pvput: When breaking down command line vales into field=value pairs, verify if the "field" is a valid remote type. If not, tread it as a bare value --- pvtoolsSrc/pvput.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pvtoolsSrc/pvput.cpp b/pvtoolsSrc/pvput.cpp index f50bcf4..9efe813 100644 --- a/pvtoolsSrc/pvput.cpp +++ b/pvtoolsSrc/pvput.cpp @@ -112,8 +112,16 @@ struct Putter : public pvac::ClientChannel::PutCallback if(sep==std::string::npos) { bare.push_back(values[i]); } else { - pairs.push_back(std::make_pair(values[i].substr(0, sep), - values[i].substr(sep+1))); + pvd::PVFieldPtr fld(root->getSubField(values[i].substr(0, sep))); + if(fld) + // If the first substring is a valid "field", tread this value + // as a field=value pair + pairs.push_back(std::make_pair(values[i].substr(0, sep), + values[i].substr(sep+1))); + else + // If the first substring is not a valid "field", then tread this + // value as a bare value instead + bare.push_back(values[i]); } }