Merged with trunk R708

git-svn-id: svn://localhost/ardour2/branches/midi@712 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2006-07-28 01:08:57 +00:00
parent 60454cc8dc
commit 8277d134b9
147 changed files with 3524 additions and 2683 deletions

View file

@ -7,9 +7,11 @@ strip_whitespace_edges (string& str)
{
string::size_type i;
string::size_type len;
string::size_type s;
string::size_type s;
len = str.length();
/* strip front */
for (i = 0; i < len; ++i) {
if (isgraph (str[i])) {
@ -17,14 +19,26 @@ strip_whitespace_edges (string& str)
}
}
s = i;
/* strip back */
if (len > 1) {
s = i;
i = len - 1;
do {
if (isgraph (str[i]) || i == 0) {
break;
}
for (i = len - 1; i >= 0; --i) {
if (isgraph (str[i])) {
break;
}
--i;
} while (true);
str = str.substr (s, (i - s) + 1);
} else {
str = str.substr (s);
}
str = str.substr (s, (i - s) + 1);
}