From fcc7d4c4d708bce9976739d45a3f2bc535dcff33 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 19 Aug 2008 20:35:35 +0000 Subject: Fix loading nested patches. git-svn-id: http://svn.drobilla.net/lad/ingen@1449 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/serialisation/Parser.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libs/serialisation/Parser.cpp b/src/libs/serialisation/Parser.cpp index 79c69648..8e158d05 100644 --- a/src/libs/serialisation/Parser.cpp +++ b/src/libs/serialisation/Parser.cpp @@ -219,8 +219,11 @@ Parser::parse_patch( patch_poly = poly_param->second.get_int32(); } - const Glib::ustring subject = ((object_uri[0] == '<') + Glib::ustring subject = ((object_uri[0] == '<') ? object_uri : Glib::ustring("<") + object_uri + ">"); + + if (subject[0] == '<' && subject[1] == '/') + subject = string("<").append(subject.substr(2)); //cout << "**** LOADING PATCH URI " << object_uri << ", SUBJ " << subject // << ", ENG BASE " << engine_base << endl; @@ -252,6 +255,8 @@ Parser::parse_patch( patch_path = Path(engine_base + symbol); else if (Path::is_valid(engine_base)) patch_path = (Path)engine_base; + else if (Path::is_valid(string("/").append(engine_base))) + patch_path = (Path)(string("/").append(engine_base)); else cerr << "WARNING: Illegal engine base path '" << engine_base << "', loading patch to root" << endl; -- cgit v1.2.1