From b8a12b0e5b517704459bcedae958dc07baed0600 Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 9 Jul 2008 16:17:52 +0000 Subject: [PATCH] let readProperties() refuse to overwrite write-proteced properties --- simgear/props/props_io.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/simgear/props/props_io.cxx b/simgear/props/props_io.cxx index d6612237..88d4c370 100644 --- a/simgear/props/props_io.cxx +++ b/simgear/props/props_io.cxx @@ -103,6 +103,7 @@ private: int _default_mode; string _data; SGPropertyNode * _root; + SGPropertyNode null; int _level; vector _state_stack; string _base; @@ -189,6 +190,11 @@ PropsVisitor::startElement (const char * name, const XMLAttributes &atts) // Got the index, so grab the node. SGPropertyNode * node = st.node->getChild(name, index, true); + if (!node->getAttribute(SGPropertyNode::WRITE)) { + SG_LOG(SG_INPUT, SG_ALERT, "Not overwriting write-protected property " + << node->getPath()); + node = &null; + } // Get the access-mode attributes, // but don't set yet (in case they -- 2.39.5