aboutsummaryrefslogtreecommitdiffstats
path: root/src/oids.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-08-22 23:08:22 +0000
committerlloyd <[email protected]>2006-08-22 23:08:22 +0000
commitd22706440b51b15df905f03396efc6bf7a42e809 (patch)
tree3e8ac0496edf1d196f5614749bef395f17a591a8 /src/oids.cpp
parent51e7c90fa717be4e08ef00496fa0bd6a84c1b641 (diff)
Have OIDS::lookup do the right thing when given an OID that isn't
registered in the name database, or asked to lookup an OID with a bare OID string representation.
Diffstat (limited to 'src/oids.cpp')
-rw-r--r--src/oids.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/oids.cpp b/src/oids.cpp
index 4c56ff558..6b96b3656 100644
--- a/src/oids.cpp
+++ b/src/oids.cpp
@@ -28,7 +28,10 @@ void add_oid(const OID& oid, const std::string& name)
*************************************************/
std::string lookup(const OID& oid)
{
- return global_config().get("oid2str", oid.as_string());
+ std::string name = global_config().get("oid2str", oid.as_string());
+ if(name == "")
+ return oid.as_string();
+ return name;
}
/*************************************************
@@ -36,7 +39,10 @@ std::string lookup(const OID& oid)
*************************************************/
OID lookup(const std::string& name)
{
- return OID(global_config().get("str2oid", name));
+ std::string value = global_config().get("str2oid", name);
+ if(value == "")
+ return OID(name);
+ return OID(value);
}
/*************************************************