1
0
Fork 0

Forgot to handle "unspecified" properties in getprop(). Treat them

as strings.
This commit is contained in:
andy 2004-03-24 19:06:54 +00:00
parent b3ce2c3cfe
commit 3ddfd77781

View file

@ -143,12 +143,14 @@ static naRef f_getprop(naContext c, naRef args)
return naNum(p->getDoubleValue()); return naNum(p->getDoubleValue());
case SGPropertyNode::STRING: case SGPropertyNode::STRING:
case SGPropertyNode::UNSPECIFIED:
{ {
naRef nastr = naNewString(c); naRef nastr = naNewString(c);
const char* val = p->getStringValue(); const char* val = p->getStringValue();
naStr_fromdata(nastr, (char*)val, strlen(val)); naStr_fromdata(nastr, (char*)val, strlen(val));
return nastr; return nastr;
} }
case SGPropertyNode::ALIAS: // <--- FIXME, recurse?
default: default:
return naNil(); return naNil();
} }