1
0
Fork 0

parsesvg: fix checking for relative/absolute path

This commit is contained in:
Thomas Geymayer 2013-01-11 19:56:42 +01:00
parent 6d8940c4e0
commit ef95c4cf10

View file

@ -426,8 +426,21 @@ var parsesvg = func(group, path, options = nil)
stack[-1].setText(data);
};
if( path[0] != '/' )
path = getprop("/sim/fg-root") ~ "/" ~ path;
# check path relative to standard locations
foreach(
var p;
[ "", # absolute path
getprop("/sim/aircraft-dir") ~ "/", # current aircraft path
getprop("/sim/fg-root") ~ "/" # fgdata
])
{
var tmp_path = p ~ path;
if( io.stat(tmp_path) != nil )
{
path = tmp_path;
break;
}
}
call(func parsexml(path, start, end, data), nil, var err = []);
if( size(err) )