Skip to content

Commit 399c8d5

Browse files
authored
Merge pull request #1600 from opensim-org/tkuchida-fix1599
Avoid excluding single-character Component name in path
2 parents 8cd3e34 + 1bfa2ee commit 399c8d5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

OpenSim/Common/Component.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ Array<std::string> Component::getStateVariableNames() const
745745
std::string::size_type front = subCompName.find_first_not_of(" \t\r\n");
746746
std::string::size_type back = subCompName.find_last_not_of(" \t\r\n");
747747
std::string prefix = "";
748-
if (back > front) // have non-whitespace name
748+
if (back >= front) // have non-whitespace name
749749
prefix = subCompName + "/";
750750
for (int j = 0; j<nsubs; ++j) {
751751
names.append(prefix + subnames[j]);
@@ -760,7 +760,7 @@ Array<std::string> Component::getStateVariableNames() const
760760
std::string::size_type front = subCompName.find_first_not_of(" \t\r\n");
761761
std::string::size_type back = subCompName.find_last_not_of(" \t\r\n");
762762
std::string prefix = "";
763-
if(back > front) // have non-whitespace name
763+
if(back >= front) // have non-whitespace name
764764
prefix = subCompName+"/";
765765
for(int j =0; j<nsubs; ++j){
766766
names.append(prefix+subnames[j]);
@@ -774,7 +774,7 @@ Array<std::string> Component::getStateVariableNames() const
774774
std::string::size_type front = subCompName.find_first_not_of(" \t\r\n");
775775
std::string::size_type back = subCompName.find_last_not_of(" \t\r\n");
776776
std::string prefix = "";
777-
if (back > front) // have non-whitespace name
777+
if (back >= front) // have non-whitespace name
778778
prefix = subCompName + "/";
779779
for (int j = 0; j<nsubs; ++j) {
780780
names.append(prefix + subnames[j]);

0 commit comments

Comments
 (0)