From 5a2863081e4bb3397f66e098d278bdcbfb493ba0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 21 Dec 2008 23:31:24 +0000 Subject: Make Path::is_valid_name reject names containing a slash (fix ticket #313). git-svn-id: http://svn.drobilla.net/lad/trunk/raul@1896 a436a847-0d15-0410-975c-d299462d15a1 --- raul/Path.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/raul/Path.hpp b/raul/Path.hpp index ea5b4b2..b6b0b60 100644 --- a/raul/Path.hpp +++ b/raul/Path.hpp @@ -75,7 +75,8 @@ public: static bool is_valid(const std::basic_string& path); static bool is_valid_name(const std::basic_string& name) { - return name.length() > 0 && is_valid(std::string("/").append(name)); + return name.length() > 0 && name.find("/") == std::string::npos + && is_valid(std::string("/").append(name)); } static std::string pathify(const std::basic_string& str); -- cgit v1.2.1