From 1a2962681ff62598f6cbe9aed9c5d4c69c0020a6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 2 Jan 2007 01:57:01 +0000 Subject: Fixed path nameify/pathify bug when brackets followed spaces in input. git-svn-id: http://svn.drobilla.net/lad/raul@228 a436a847-0d15-0410-975c-d299462d15a1 --- raul/Path.h | 1 + tests/path_test.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/raul/Path.h b/raul/Path.h index e79e111..c19767d 100644 --- a/raul/Path.h +++ b/raul/Path.h @@ -169,6 +169,7 @@ public: if (str[i] == ' ' || str[i] == '_') { str[i+1] = std::toupper(str[i+1]); // capitalize next char str = str.substr(0, i) + str.substr(i+1); // chop space/underscore + --i; } else if (str[i] == '[' || str[i] == '{') { str[i] = '('; } else if (str[i] == ']' || str[i] == '}') { diff --git a/tests/path_test.cpp b/tests/path_test.cpp index 1620703..911b760 100644 --- a/tests/path_test.cpp +++ b/tests/path_test.cpp @@ -12,5 +12,7 @@ main() cerr << (Path("/foo").is_parent_of(Path("/foo/bar"))) << endl; cerr << !(Path("/foo").is_parent_of(Path("/foo2"))) << endl; + cerr << Path::nameify("Signal Level [dB]") << endl; + return 0; } -- cgit v1.2.1