Skip to content

Commit

Permalink
Merge pull request #1600 from opensim-org/tkuchida-fix1599
Browse files Browse the repository at this point in the history
Avoid excluding single-character Component name in path
  • Loading branch information
aseth1 authored Mar 22, 2017
2 parents 8cd3e34 + 1bfa2ee commit 399c8d5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OpenSim/Common/Component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ Array<std::string> Component::getStateVariableNames() const
std::string::size_type front = subCompName.find_first_not_of(" \t\r\n");
std::string::size_type back = subCompName.find_last_not_of(" \t\r\n");
std::string prefix = "";
if (back > front) // have non-whitespace name
if (back >= front) // have non-whitespace name
prefix = subCompName + "/";
for (int j = 0; j<nsubs; ++j) {
names.append(prefix + subnames[j]);
Expand All @@ -760,7 +760,7 @@ Array<std::string> Component::getStateVariableNames() const
std::string::size_type front = subCompName.find_first_not_of(" \t\r\n");
std::string::size_type back = subCompName.find_last_not_of(" \t\r\n");
std::string prefix = "";
if(back > front) // have non-whitespace name
if(back >= front) // have non-whitespace name
prefix = subCompName+"/";
for(int j =0; j<nsubs; ++j){
names.append(prefix+subnames[j]);
Expand All @@ -774,7 +774,7 @@ Array<std::string> Component::getStateVariableNames() const
std::string::size_type front = subCompName.find_first_not_of(" \t\r\n");
std::string::size_type back = subCompName.find_last_not_of(" \t\r\n");
std::string prefix = "";
if (back > front) // have non-whitespace name
if (back >= front) // have non-whitespace name
prefix = subCompName + "/";
for (int j = 0; j<nsubs; ++j) {
names.append(prefix + subnames[j]);
Expand Down

0 comments on commit 399c8d5

Please sign in to comment.