Forgot to handle "unspecified" properties in getprop(). Treat them
as strings.
This commit is contained in:
parent
b3ce2c3cfe
commit
3ddfd77781
1 changed files with 2 additions and 0 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue