]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGConfigFile.cpp
Updates from JSBSim, including new turbine engine model from David Culp
[flightgear.git] / src / FDM / JSBSim / FGConfigFile.cpp
index a3bb234773072f35c0c77d566d57eb67cafab6f4..c6c3832880ed5177a293b2c88347e706587179c9 100644 (file)
@@ -21,6 +21,8 @@ INCLUDES
 #include <stdlib.h>
 #include <math.h>
 
+namespace JSBSim {
+
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_CONFIGFILE;
 
@@ -221,6 +223,12 @@ string FGConfigFile::GetLine(void)
       }
     }
   }
+
+  int index = scratch.find_last_not_of(" ");
+  if (index != string::npos && index < (scratch.size()-1)) {
+    scratch = scratch.substr(0,index+1);
+  }
+
   if (cfgfile.eof() && scratch.empty()) return string("EOF");
   return scratch;
 }
@@ -339,4 +347,4 @@ void FGConfigFile::Debug(int from)
     }
   }
 }
-
+}