diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-02-07 13:38:15 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-02-07 13:56:44 -0500 |
commit | 60a9213035d3c9b8e17686778c70d91aa6acd356 (patch) | |
tree | b006377949efa8b9e83f5ecb932755e40f05c94a /libs | |
parent | 7bc3e0dab4dfac04d6c2957a2278345605c09769 (diff) |
fix utter confusion about session _path in new sessions.
Yikes!
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/session_state.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 1728c11244..6d535b8e59 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -136,13 +136,21 @@ Session::pre_engine_init (string fullpath) /* discover canonical fullpath */ char buf[PATH_MAX+1]; - if (!realpath (fullpath.c_str(), buf) && (errno != ENOENT)) { - error << string_compose(_("Could not use path %1 (%2)"), buf, strerror(errno)) << endmsg; - destroy (); - throw failed_constructor(); - } - _path = string(buf); + if (!realpath (fullpath.c_str(), buf)) { + if (errno == ENOENT) { + /* fullpath does not exist yet, so realpath() returned + * ENOENT. Just use it as-is + */ + _path = fullpath; + } else { + error << string_compose(_("Could not use path %1 (%2)"), buf, strerror(errno)) << endmsg; + destroy (); + throw failed_constructor(); + } + } else { + _path = string(buf); + } /* we require _path to end with a dir separator */ |