]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGPropertyManager.cpp
JSBSim updates. This update changes the file format, so an update of the base
[flightgear.git] / src / FDM / JSBSim / FGPropertyManager.cpp
index 09337b899d6734d50215a6a49c98d947adc8d485..1253d6d2d03884684fd6bbfb1801a7305c02c753 100644 (file)
@@ -31,6 +31,10 @@ INCLUDES
 #include <simgear/misc/props.hxx>
 #include "FGPropertyManager.h"
 
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+DEFINITIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
@@ -47,15 +51,23 @@ COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
 
 string FGPropertyManager::mkPropertyName(string name, bool lowercase) {
   
+  /* do this two pass to avoid problems with characters getting skipped
+     because the index changed */
+
   for(unsigned i=0;i<name.length();i++) {
     if( lowercase && isupper(name[i]) )
       name[i]=tolower(name[i]);
     else if( isspace(name[i]) ) 
       name[i]='-';
   }
+  for(unsigned i=0;i<name.length();i++) {
+    if( name[i] == '/' )
+      name.erase(i,1);  
+  }
+
   return name;
 }
-  
+
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 FGPropertyManager*