diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-09 03:06:58 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-12-09 03:06:58 +0000 |
commit | 86ac8536d2a0d09347e622c2df43aebeba4e4150 (patch) | |
tree | 3508ce081b7138eb77465260df873cc1a056d8dd /libs/ardour/session.cc | |
parent | 26366a40629693b387331c81ed255116fa8f7f7c (diff) |
centralize legal-session-name-checkng and include : and ; in characters that we disallow, because they conflict with search path conventions on *nix and windows
git-svn-id: svn://localhost/ardour2/branches/3.0@10943 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r-- | libs/ardour/session.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index d0ca765754..4f5e8093bb 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4543,3 +4543,16 @@ Session::update_latency_compensation (bool force_whole_graph) } } +char +Session::session_name_is_legal (const string& path) +{ + char illegal_chars[] = { '/', '\\', ':', ';', '\0' }; + + for (int i = 0; illegal_chars[i]; ++i) { + if (path.find (illegal_chars[i]) != string::npos) { + return illegal_chars[i]; + } + } + + return 0; +} |