summaryrefslogtreecommitdiffstats
path: root/src/ingen
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-12-22 04:38:18 +0000
committerDavid Robillard <d@drobilla.net>2008-12-22 04:38:18 +0000
commitc349af8e91937111579de7b5fc1e9e2b4807a7c9 (patch)
tree49930de7d4e7333473b0e8828ff3e2aa078dc030 /src/ingen
parentb0ebc32bb935838fb02fbda6ab8390852e318305 (diff)
downloadingen-c349af8e91937111579de7b5fc1e9e2b4807a7c9.tar.gz
ingen-c349af8e91937111579de7b5fc1e9e2b4807a7c9.tar.bz2
ingen-c349af8e91937111579de7b5fc1e9e2b4807a7c9.zip
Fix ingen -l (fix ticket #314).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1903 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/ingen')
-rw-r--r--src/ingen/main.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp
index 94f20aef..f1f2aa1c 100644
--- a/src/ingen/main.cpp
+++ b/src/ingen/main.cpp
@@ -241,19 +241,23 @@ main(int argc, char** argv)
/* Load a patch */
if (args.load_given && engine_interface) {
- boost::optional<Path> data_path;
+ boost::optional<Path> data_path = Path("/");
boost::optional<Path> parent;
boost::optional<Symbol> symbol;
- const Glib::ustring path = (args.path_given ? args.path_arg : "/");
- if (Path::is_valid(path)) {
- const Path p(path);
- parent = p.parent();
- const string s = p.name();
- if (Symbol::is_valid(s))
- symbol = s;
- } else {
- cerr << "Invalid path: '" << path << endl;
+ if (args.path_given) {
+ const Glib::ustring path = args.path_arg;
+ if (Path::is_valid(path)) {
+ const Path p(path);
+ if (p != "/") {
+ parent = p.parent();
+ const string s = p.name();
+ if (Symbol::is_valid(s))
+ symbol = s;
+ }
+ } else {
+ cerr << "Invalid path given: '" << path << endl;
+ }
}
bool found = false;